How do I retrieve data from iCloud?

In case we lost data on iPhone, the best way for us is to restore from iCloud. If you have enabled iCloud, it stores all kinds of things from photos, contacts, reminders, safari histories and so on. After you delete files from iPhone, you have 30 days to restore them via iCloud.  But you should notice that when you restore files from iCloud, it will replace everything that is currently on your iPhone.
How to restore files from iCloud.com?
Open iCloud.com in yout web browser on iPhone and sign in with your Apple ID.
On the iCloud dashboard, you can see different apps, click Settings icon to go to your iCloud Settings.
In iCloud Settings part, you can see all your devices. And scroll down you can find Restore Files in Advanced.
Click Restore files, it will list your recently deleted files. Tick the box next to the files and then click Restore File button.
iCloud will prompt you to make sure you’re sure you want to restore your files.
Similarly, you can click Restore Contacts, Restore Calendars and Reminders, or Restore Bookmark in iCloud Settings to restore them.
When you are trying to restore contacts, it will require you to select one archive of contacts to restore, you can restore according to the backup time. Click Restore to confirm your operation. It will automatically sync your device with the restored archive that you choose.
iCloud restore problems
If you have troubles in syncing data to your iPhone, how to solve these issues. First, you should wait with patience. The Apple has said that the sync process may take 6 hours to complete. If you have several iOS devices, this process could take longer time for the network speed. Make sure that your iPhone has been connected to Internet. If your iPhone is powered off or disconnected from Internet, the sync cannot be completed.
If the problem still exist, you should contact Apple for help.
In addition to restore from iCloud, you still can choose to restore from iTunes backup. To backup iPhone to iTunes, you just need connect iPhone with computer and sync them. The iTunes backup will keep on your system drive by default. As long as it does not been erased from your hard drive, you can restore your iPhone from backup at any time.  To restore files from iTunes backup, you can choose to restore the entire backup to iPhone, or choose to use an iPhone data recovery softwareto selectively restore the files you need.