Connect your iPhone to the computer that has your backup saved in iTunes.Whether you want to restore the backup on your current device, or restore it on a new iPhone, the same steps apply: Depending on your iTunes version, you may have to right-click the device and choose Backup Now. If it doesn’t automatically sync, head to File > Devices > Back up.
Make sure you’ve saved an iTunes backup of your iOS device. Then, follow the initial steps in the iOS Setup Assistant, select Restore from iCloud Backup when prompted and select the backup you created.
To wipe your device, tap Settings > General > Reset > Erase All Content and Settings.