When iOS 10 was released, there was an iCloud Drive bug that caused many users to lose all of their documents that were stored in iCloud Drive. Apple fixed that issue, but there are still rare problems that pop up that can cause iCloud content to be erased, either through user error or through bugs in the operating system.
Following the iOS 10 iCloud Drive deletion snafu, Apple quietly introduced tools to recover deleted files from iCloud, and more recently, added a way to recover Contacts, Calendars, and Reminders, giving users a way to restore any lost content. This is a little known feature, but it's good to know about if you run into an issue that wipes out content on your iOS device.
The first step is to log into iCloud on the web. These recovery tools are only available through iCloud.com. They are not present in the iCloud Settings app on iOS 10 or within the dedicated iCloud Drive app that's available in iOS 12.
To log into iCloud.com:
Visit iCloud.com in a web browser of choice, such as Safari or Chrome.
Enter your Apple ID and password.
If you have two-factor authentication turned on, you'll need a trusted device to generate a code to log into iCloud and access the settings.
To access the recovery settings:
Click on the "Settings" app in the main iCloud menu.
Scroll down to the bottom of the page until you get to the "Advanced" section."
Click on the content you need to restore. Options are files stored in iCloud Drive, a list of contacts, or your Calendar and Reminders. Restoring files:
Using the "Restore Files" option on iCloud.com brings up a list of all files that have been deleted over the past 30 days. It includes files from apps that support iCloud Drive, such as Pixelmator, Napkin, and Byword.