A recently discovered bug via “Erase All Content and Settings” on iOS 8 can cause permanent erasure of documents iCloud Drive.
iCloud Drive, part of iOS 8 and OS X 10.10 Yosemite as a differential feature of the integration of both operating systems, allows storing files in a central location so that any application can access the data in both OS X 10.10 Yosemite and iOS 8 iCloud Drive Documents which differs from the schema file storage in the cloud used so far by Apple, and is not compatible with earlier versions of OS X and iOS, so to exit OS X 10.10 Yosemite this feature will not be fully operational.
“Erase All Content and Settings” is one of the menu options is available to reset the Settings> General application. The problem, however, did not affect all users.
Apparently the bug only deletes files that can be opened natively on iOS 8, other OS X dependent files, such as text documents stored in TextEdit or Preview images are not affected.