Despite Apple's continued work on it, iCloud is still kind of a mess that's hard to understand. For example, at a glance using Finder, it seems like you can't recover hidden files. However, as Six Colours points out, if you hop into the web app (remember the web app?), you'll find a way to recover deleted files pretty easily.
The process for recovering deleted files is simple:
- Head to iCloud.com and log in
- Click username > Settings
- Click on Data & Security
- You'll see a box pop up with Recover Documents selected, you can select whichever files you need to recover
That's it, once you recover files, they should repopulate into iCloud.
Recovering deleted iCloud Drive Files [Six Colors]