How to reset Iphone 5 to factory settings?

My iphone 5 was "borrowed" by a mate who thought it would be funny to put a passcode on it. Now that I have it back I can't get into it. How do I either get into my phone without knowing the passcode or reset it to its original settings?

Thru itunes. Also, thru your settings. Or you could just google it.

  • Will the MAC address of my iPhone reset if I reset my iPhone to its factory settings over iTunes? I have jailbroken my device and used terminal to change my MAC address so that I could connect to school's Wi-Fi. But when I wanted to change it to its initial number, I typed in a wrong value and it just messed up my Wi-Fi, I can't connect to Wi-Fi anymore. Wonder if resetting to factory settings would help…
  • Why won't my iphone 5 reset to factory settings? I held the power and home button until the apple logo came up, then i released the power button and kept holding the home button. But as i kept holding the home button the apple logo stayed on the screen and the phones lockscreen popped up… can anyone tell me what i'm doing wrong? @T-Bone i can't go into settings… I forgot the passowrd
  • Why won't my iphone 5 reset to factory settings? - 1 My iPhone is jail broken and I tried to sync it with my laptop and it kept coming up USB not recognised. So I went to the settings on the phone and tried to reset it through there so now all its doing is spinning like the phone is turning off! Anyone got any ideas how to fix this?
  • What will happen if I reset my iPhone to factory settings? And how do I do it? I just got iOS7 but I have to say, I'm very disappointed with the outcome. If I reset it to "factory settings" will it go back. Also if I do that will it delete everything on my iPhone. Actually, scratch that.iOS7 already deleted EVERYTHING. I very much dislike this. How do I go back?