If the data on your iPhone ever gets deleted, or if you have to perform a DFU restore on your iPhone, you can recover and restore the data from an iCloud backup if you have previously backed up the data.
How Do I Restore A Backup From iCloud?
- Make sure your iPhone is not plugged into your computer.
- During the iPhone set up process, select Restore from iCloud Backup when promoted on the Apps & Data screen.
- Sign into iCloud.
- Select Choose Backup.
- From the list of backups, choose the one you want to use to restore data on your iPhone.
- If you already set up your iPhone and didn't restore from iCloud Backup, you'll have to erase all content and settings, then set up your iPhone again. To do so, go to Settings -> General -> Reset -> Erase All Content and Settings.