BlackSn0w the application you will be using to unlock your device, BlackSn0w is part of RC3.If you accidentally locked your iPhone on baseband 05.11.07, you will now be able to unlock your iPhone using BlackSn0w. To check what OS version you have and your iPhone and baseband go to Settings/General/About; once you get there scroll down to "Version". The version should be 3.1.2 (7D11).Your baseband is the last on the list, scroll down to "Modem Firmware", it should be 05.11.07. If none of this matches you will need to upgrade to firmware 3.1.2.
This tutorial will only work if you are running OS 3.1.2 on baseband 05.11.07. I will assume that your iPhone is not already jailbroken or unlocked.
Before We Begin You'll