The following procedure is a special firmware recovery mode (DFU). It will erase your Apple device, removing any passcodes, re-install the operating system, and then re-sync user data once it is done (provided you have a backup of some kind).
Make sure you have downloaded and installed the latest version of iTunes on your computer before attempting this:
(Mac users can run System Preferences > Software Update (or “Apple Store” for OS X 10.9 users) > Check now to get the latest version for their system in most cases.)
* Open iTunes on your computer and connect the Apple device directly to it
* Turn off the Apple device (press the sleep/wake button on the top until the device completely shuts off).
* Hold down the sleep/wake button (on the top) AND the home button (on the front) for 10 seconds
* Release the sleep/wake button but CONTINUE to hold the home button, until...
* iTunes should pop up and tell you it’s found a device in recovery mode, click OK and continue along for the restore.
Note: it may ask whether you wish to restore a backup from iTunes or from iCloud. You should use iCloud.
When it has completely finished, you should be back up and running.
The iCloud restore may take some time.
Your device is restored as follows: Your settings and accounts are restored from the iCloud backup you chose. Your device restarts and begins downloading your purchased music, movies, TV shows, apps, books, Camera Roll, and other content.
You may be asked to enter passwords for iTunes, App Store, and iBookstore accounts to restore purchased items. If your device can’t download the version of an app that was backed up, it downloads the latest version.
Progress bars appear below Home screen icons for apps being downloaded. To make an app a priority for downloading, tap its icon.
To check if the information on your device is fully restored, go to Settings > iCloud > Backup.