Be sure that the iPhone to a Mac or PC is not connected to the Mac or PC.
Open iTunes on your Mac (or PC).
Hold down the Sleep/Wake button and use the Slide To Power Off to turn off the iPhone.
Hold down the Home Button.
With the Home button held down, attach the Lightning cable to the iPhone.
The iPhone will power up in Recover Mode. The screen will display a blue iTunes logo and a white lightning cable. iTunes will display a message saying 'iTunes has detected an iPad in recovery mode. You must restore this iPad before it can be used with iTunes.
Now Click OK and Restore and Update.
Click Restore iPad and let iTunes wipe the software and restore the iPad.
Enter the Apple ID and Password that was used to set up the iPad.
Click Continue.
Click Continue.
Your iPhone will now start as before but without a passcode.

ConversionConversion EmoticonEmoticon