The iPhone gives owners the option of setting a four-digit PIN to lock the phone's screen in order to prevent others from accessing personal information on the phone. This feature, however, can backfire if you forget the code. In order to reset an iPhone with a missing PIN screen lock code, you must restore the phone using the computer with which you usually sync the device. Restoring the phone clears it to factory settings. However, iTunes automatically backs up the phone's settings each time you sync it. After the reset, you can return the phone to previous settings by syncing it again.
Connect the iPhone to the computer with the iPhone's USB cable and open iTunes.
Click the iPhone beneath "Devices" in iTunes.
Click "Restore" when the "Summary" pane opens.
Select "Back up" if you want to create a current snapshot of the iPhone's data. If you have a backup copy, choose "Don't back up."
Click "Restore" when a new prompt appears.
Click "OK" after the iPhone restores.
Follow the on-screen iTunes iPhone activation steps to restore the phone to a previous backup copy.