You have to restore it on the last computer you synced with. This will remove the lock code. You will need to have a SIM in the phone for the Restore to complete. It does not have to be a currently working SIM. BTW, if you have an iPhone 3G you do not have iOS 6 on it; the last version supported on the 3G is 4.2.1.