Watch this: Unjailbreak your iPhone, iPad, or iPod Touch
Jailbreaking isn't for everyone. Cydia is quick to overwhelm even the tech-savvy user, and upgrading iOS software on a jailbroken device can be a headache-inducing process.
Whether you've discovered that jailbreaking isn't for you, or you need to take your iDevice to the Genius Bar for repair, you'll need to unjailbreak your device.
There are plenty of forums, blog posts, and YouTube videos that attempt to guide you through this process. Many are outdated, and, in some cases, incorrect.
So, to find the proper way to unjailbreak an iDevice, I went to the source. Nikias Bassen, a developer for the Chronic-Dev team, the folks behind the Absinthe jailbreak and greenpois0n.com, offered this simple solution:
Back up your iDevice. Sync it with iTunes or iCloud to make sure you have a back up of your phone's current state. Whether you're using iTunes or iCloud, make sure you tweak the sync settings so that everything you need is backed up. With iCloud, you can force a backup by going to Settings > iCloud > Storage and Backup > Back Up Now.
Restore. When the backup is complete and your device is connected to iTunes, select it from the sidebar. Then, in the Summary tab, click "Restore." Now iTunes will restore your iPhone, iPad, or iPod to factory settings and completely wipe the device.
Recover your backup. Now your device will display guide you through activation. Once you pass the Wi-Fi setup screen, you'll be asked how you'd like to set up your device. If you did an iCloud backup, select that option. Otherwise, go to iTunes and restore it from the backup you created in the first step.
In a few minutes, your device will restart, and your apps, settings, and other data (like contacts) will be restored. Cydia is gone, and when you take your iDevice to the Genius Bar, there will be no obvious traces that you once broke your gadget out of jail.