How to Factory Reset an iPhone without Losing All Your Data
It is important to make sure that your iPhone is up to date with the latest version of the iOS operating system before beginning the factory reset process. To do this, open the Settings app and tap General.