Hi there, there are two ways for you to perform the data recovery, one is the Time Machine backup and the other one is APFS Snapshot.
Time Machine backs up files and folders on your Mac if you enable it to do so. You can access the Time Machine backup drive to restore the updated version of files overwritten by iCloud Drive.
APFS Snapshot rolls back your Mac to an early point for you to access the captured files, if you have taken one, give it a try.