M-Files only stores the file contents at check in.
If a document is created, but not checked in for the first time it only exists in the local cache on the authoring PC. If you 'undo checkout' in this particular case the file no longer exists. I don't know enough about the internal workig of M-Files to know if it could be recovered from the local cache if you acted quickly enough.
After a document has been checked in at least once, it is saved in the vault. Now using 'undo checkout' will only lose the changes made on the checked out document - the previous version in the vault remains intact.