iCloud doesn't keep older version of files like DropBox
To start off, this is my mistake. I was working on a python program on a mac and windows machine. The file is saved on iCloud and can be access from both machines.
The mistake is that at one point, the file was open on both machines. Changes had been made on the windows machine, saved and ran and checked. It worked great.
Problem is on seconday, the file was reverted back to before editing, same as the file opened on mac (but was not editted). My guess it somehow overwrote the edit made on windows machine.
This could have been rescued if I can access one edit back in the older version. But iCloud is not showing this option.
There are documents pointing to iCloud have version control, such as here:
Restore an earlier version of a document in Pages for iCloud - Apple Support
If versioning is no longer supported, or not offerred by iCloud at all, it is really behind other cloud storage providers.