Sometime I noticed that you can’t undeploy the composite from SOA EM console.It is little bit irritating and can be of various reason like not deployed properly , database reference is null etc.
But I figured out undeployment procedure of SOA composite manually apart from wizard based.It worked fine for me.Here are the steps,
Login to EM console and go to mds configuration,
soa-infra_metadata.zip file will be downloaded.Unzip the same and you will find deployed-composites folder and underneath deployed-composites.xml like below,
Delete the entry of whatever the composite you want to undeploy.You can delete the respective composite from your partition folder. Then zip it again and import the MDS from EM.
You need to restart the server and after that your composite will be gone !!!