How do you reset n iPhone to factory settings?
plug your iphone into itunes and there should be a button which you click to restore it. First it would ask you if you want to backup your files (i.e. contacts, music etc) that is on your iphone.
Go to Settings>Reset>Erase All Content and Settings. You will likely be prompted as to whether or not you are sure. Say that you are and it will reset.
Hope that helps!
Retrieving data ...