The clean finished, the disk looks better, and then you remember: the installer in Downloads you still needed, the app folder you ticked too fast, the screenshot folder you thought was junk. The good news: everything CleanMate moved to the Trash can be put back for as long as the Trash holds it — from the app, and from the command line. What was deleted outright cannot, and that is by design. Here is how both work, on a Mac and on Ubuntu.
On a Mac: Undo and View Moved Items…
Right after a move to the Trash, the Undo button (or Edit › Undo, ⌘Z) puts the items of that last move back where they were. It works only while the items are still in the Trash, never over something now in their place, and only if their folder still exists — anything it cannot put back stays in the Trash and is counted. The Undo button lasts until CleanMate quits.
For anything older, View Moved Items… — next to Undo after a move, and in Settings › Activity — opens the Moved to the Trash window: everything CleanMate has moved to the Trash from any module (Smart Scan, Privacy, Large & Old Files, Similar Photos, Uninstaller, Space Lens, Login Items or the command line), newest first, with the original folder, date and size. It stays complete even after CleanMate was quit. Put Back returns one item to where it was; Put Back All Shown… returns everything the filter and search show, after a confirmation. An item that cannot go back keeps its row with the reason: something with the same name is there now, or its folder was moved, renamed, removed or is now a link. Items emptied from the Trash or deleted permanently are not listed.
From Terminal, the same list and the same restore work without opening the app:
cleanmate restore --list # everything still in the Trash, newest first
cleanmate restore TRASHED… # put items back, named by their path in the Trash
On Ubuntu: the Moved to the Trash page and cm restore
The desktop app has the same two layers. Undo returns the last move while you are on the same page. The Moved to the Trash page (also under Settings › Moved to the Trash) lists everything CleanMate moved to the Trash — from any page, the terminal app or an earlier session — newest first, with its original folder, the tool that moved it, the date and the size. Search or filter by tool, then Put Back one item, the ticked ones or all of them with Put Back All…; each returns to the folder it came from, and one whose place another file has taken stays in the Trash. Show in Files shows an item in the Trash. Items emptied or deleted from the Trash in the last 30 days stay listed, greyed out, as No longer in the Trash.
In the terminal app, cm restore --list prints the same list for people, and cm --json restore --list prints it as one JSON object for scripts — everything CleanMate moved to the Trash and that is still there, newest first, at most 200 items. cm --json restore KEY… puts items back by the restore keys that JSON list gives. Things you trashed yourself in Files are not listed. In the terminal app itself, the z key puts back what the Uninstaller just moved — leftover folders, or an app’s data after a reset.
cm restore --list # the same list, for people
cm --json restore --list # one JSON object, for scripts
cm --json restore KEY… # put items back by their restore keys
What cannot be undone, and why
Regenerable junk — caches, logs, developer caches — and privacy traces are deleted outright, not moved to the Trash, because the apps that made them rebuild them: a cleaned cache costs a slightly slower first launch, nothing else. That is also why the review before cleaning shows two totals (what goes to the Trash, what is deleted for good) and why deleted items never appear in any list: deleted junk is not listed, because it cannot be put back. Everything that is not regenerable — your files, apps, app data, old sessions, launch agents — is moved to the Trash, so this guide applies to it.
If the Trash itself refuses to empty, that is a different problem with its own fixes: Trash won’t empty or says the file is in use.
Related: the Trash on external drives, cleaning up the Downloads folder and freeing disk space on a Mac. CleanMate is free and open source: download it.
FAQ
I emptied the Trash. Can I still get files back?
Not through CleanMate: once the Trash is emptied, the moved items are gone for good, and the lists stop showing them. Restore before emptying — the lists exist exactly for that check.
Why are caches and logs missing from the list?
They are deleted outright, because the apps rebuild them. The list only holds what was moved to the Trash and can be put back.
Does Undo still work after I quit CleanMate?
The Undo button does not, but the Moved to the Trash window does: on a Mac it keeps every item of the last 20 moves even after quitting, and on Ubuntu the page lists moves from earlier sessions. cleanmate restore and cm restore work the same way.
A file is already where the restored one belongs. What happens?
The item is not put back over it: it stays in the Trash with the reason, on both systems, and you decide which one to keep.

