How to Reset an iPhone Passcodeby Jason Artman
Secure your Apple iPhone with a passcode -- a four-digit number that you must enter before you can use the device. If you are the first owner of the iPhone and have forgotten the passcode that you initially entered, you can simply reset the passcode by connecting the iPhone to the computer that was originally used to activate it. However, this does not help if you purchased the phone used and are not the original owner. Put your iPhone into recovery mode to restore the iPhone and clear the passcode.
Connect the iPhone to your computer.
Hold down the power button on the iPhone. The screen will change asking you to use a slider to power the unit off. Use the slider to power off your iPhone.
Press the power and home buttons simultaneously. The iPhone will power back on. After a few seconds, iTunes will alert you that it has detected a device. The iPhone is now in recovery mode.
Click on the "Restore iPhone" button in iTunes.
Click "Restore and Update." The iPhone reverts to its original factory settings, which will clear the passcode. This process also removes all data from the iPhone, including music, contacts, notes, text messages and saved emails.