You really can't recover the SIM PIN. What you have to do is first find the PUK, either by:
1. Looking on the largeish card the SIM chip came attached to or
2. Calling T-Mobile's CS and asking them.
You then need to enter the SIM incorrectly more than 3 times which blocks the SIM. You then use the PUK (Personal Unblock Kode) to remove the block and enter a new PIN. If you mess up entering the PUK too many times (like 15) it will lock ("PUK") the SIM and you will have to get a new one.
You might want to do this when you are near an open T-Mobile store in case you need to buy a new SIM.
Manage your T-Mobile account