Undoing a bulk rename you regret
You renamed four hundred files and immediately realised the pattern was wrong. Whether you can get the old names back depends on what did the renaming and how long ago. Here is every route, from the immediate undo to reconstructing names from a backup.
You ran a bulk rename, looked at the result, and your stomach dropped. The dates are in the wrong order. The counter restarted halfway. Or the original names contained information — a camera number, a client code — that you only now realise you needed.
Whether you can get the old names back depends on two things: what did the renaming, and what has happened since.
If Finder did it, and you have not done anything else
Edit → Undo — or Command-Z — in Finder, straight away.
Finder can undo its batch rename as one action, restoring every original name. This works as long as the rename is the most recent thing you did in Finder. Move a file, empty the Trash or rename something else and the undo history moves on.
If Undo is greyed out or undoes something else, do not keep pressing it. Each press may undo a different, unrelated action.
If a Terminal command or script did it
There is no undo. mv in a loop leaves no record of what the old names were.
The routes are:
- Your terminal's scrollback, if the script printed each rename as it went. Copy the output; it is the mapping you need.
- Backups, below.
- Information still inside the files, below.
Next time: have every rename script print old → new to a log file, or write the mapping first and apply it second.
If an app did it
Check the app for:
- an undo command,
- a history or log of past renames,
- an export of the rename list.
Apps built for batch renaming increasingly keep a record, precisely because this situation is common.
Restoring from a backup
Time Machine keeps previous versions of folders. Open the folder in Finder, enter Time Machine, and go back to before the rename. You will see the files with their old names.
The catch: restoring the old versions brings back copies with the old names. If you have changed the files' contents since, restoring replaces those changes. And restoring alongside the renamed files gives you two of everything.
Often the most useful thing Time Machine gives you is not the files but the list of old names. With the old and new lists side by side — sorted the same way — you can build a mapping and rename back.
Cloud folders usually keep version history too, but for renames, their web interfaces tend to show deletions and additions rather than a simple before-and-after.
Reconstructing names from inside the files
If there is no backup and no log, the original names may be partly recoverable from information in the files themselves:
- Photos and video: camera-assigned names like
IMG_4821correlate with capture time. Sorting by the capture date in the EXIF data reproduces the camera's original order, and often the original numbering. - Documents: PDF titles and document properties may match the original names.
- Audio: track titles and numbers in the tags.
It is laborious, and it only works where the information existed. But it is often better than nothing.
Reversing with a mapping
If you can recover the old names — from scrollback, a log, a backup or metadata — the reverse rename is simple: a two-column list of current name and original name, applied in one go. Watch for two things:
- Collisions: if one of the old names is currently used by another file, the reverse rename must handle it rather than overwrite.
- Swaps: if some files swapped names, the reversal needs an intermediate step.
Preventing the next one
- Preview every name before applying, not just the first few.
- Try it on a copy of the folder first.
- Keep the original name somewhere in the new one — a camera number, the old title — when in doubt.
- Keep a log of every bulk rename.
- Back up first: Command-D on the folder costs seconds.
Where RenameDeck fits
RenameDeck is a batch renamer for Mac built to make this article unnecessary.
Before anything changes, you see the complete list of proposed names, searchable, with invalid names and collisions flagged. Renames are carried out as journaled transactions, which handle swaps, cycles, case-only changes and interrupted batches without losing files, and RenameDeck never overwrites an existing file.
Afterwards, a persistent history keeps a record of what was renamed. It is identity-protected: RenameDeck offers undo only when the file at the destination is still the file it renamed — so undoing a rename weeks later cannot accidentally rename a different file that happens to have the same name now.
For reconstructing names from metadata, RenameDeck can build names from EXIF dates, media tags and PDF properties, or from an imported CSV mapping. It is sandboxed with no network entitlement, account, analytics or tracking, and requires macOS 14 or later.