How to unjailbreak an iphone?

I want to unjailbreak a friend of mines phone, but i'm not too familiar with iOS.

Will factory restoring from the settings app do that? Or do i need to connect to itunes?

I believe you must restore the phone using iTunes.

Fire up iTunes on your Mac or PC.
Connect your device via the USB cable.
Either cancel the automatic backup with the on-screen slider or let it complete.
Click on your device in the left column of iTunes on your PC or Mac screen.
Click on Restore, select Backup if you cancelled it in step 3, if you didn't cancel it, select Don't Back Up.
Your device will now be restored back to factory settings and the Jailbreak removed.
When complete, select the backup you just created and iTunes will re-install all your apps and settings, leaving your iPhone, iPad or iPod touch how it was before venturing to the dark side!

  • Would I still get my warranty if I unjailbreak my iphone 5? I heard if you have an jailbroken iPhone the company won't fix it phone, if anything would happen to it.
  • Why can't I unjailbreak my iphone 5? I want to update to 6.1.2 but I'm jail broken with evasion and when I connect if go my computer to restore it takes a long time to load and says that it's up to day or something and when I check my software update on the iPhone it never loads and when I tried resetting it it never finishes what can I do? How do I unjailbreak when nothing's working
  • What will I lose if I unjailbreak my iPhone 4? So I have had my iPhone jailbroken for a while and now i want to update to IOS6 and just simplify my phone, how do i unjailbreak it and what will I lose if I do, I just don't want to lose message history and photos.
  • Should I unjailbreak my iPhone 4? Should I? It's slowing down and i don't want to mess it up anymore. Should I unjailbreak it?