To remove all content and settings from your iPhone, iPad, or iPod touch:
If you wish to recover the data again, ensure that you have an iCloud or iTunes backup and that it is up to date.
Tap Settings > General > Reset > Erase all Content and Settings.
When you select to "Erase All Content and Settings," the process can take from a few minutes to several hours. The time this process takes will vary by iOS device: