iCloud & iCloud Photos · iCloud Drive basics
How do I recover a file I deleted from iCloud Drive?
Short answer: Look in your Mac's Trash first, then in Recently Deleted on iCloud.com, which keeps deleted iCloud Drive files for a limited time. Duplicates removed by Storage Studio also go to the Trash. Older losses need a backup.
First check the Trash on your Mac — a file deleted from iCloud Drive in Finder goes there first, and you can drag it back. If the Trash has been emptied, sign in at iCloud.com and look in iCloud Drive's Recently Deleted, which keeps deleted files for a limited time.
If you removed duplicates with Storage Studio's Duplicates window, those extra copies went to the Trash too, so the same steps bring them back.
For anything older, you'll need a backup — Time Machine, or a Storage Studio Data Backup set that included the folder. That's why a backup is worth keeping alongside iCloud. See is iCloud Drive a backup.