How to Undo a File Move on a Mac (and Find a File You Moved by Mistake)

Quick answer: Press ⌘Z in Finder right after the move to undo it. If that is too late, find the file with the Recents view or Spotlight, or look in the Trash and choose Put Back. If nothing works, restore it from Time Machine.
Moving files by mistake is easy because a move across folders gives no warning. Here is how to get a file back, in order.
Ways to get it back
| Situation | Fix |
|---|---|
| You just moved it | Press ⌘Z |
| You do not know where it went | Recents or Spotlight search |
| You deleted it | Trash, then Put Back |
| It is gone from everywhere | Restore from Time Machine |
1. Undo immediately
In Finder, choose Edit ▸ Undo Move or press ⌘Z. It undoes the last file operation, and you can press it more than once.
2. Find where it went
Click Recents in the Finder sidebar to see recently opened and modified files.
Press ⌘Space, type the file name and look at the path.
In a Finder window, press ⌘F, search for the name, and use the Kind or Last Modified filter.
3. Check the Trash
If you deleted instead of moved, open the Trash, select the file and choose File ▸ Put Back (or press ⌘Delete). It returns to its original location.
4. Restore from Time Machine
Open the folder where the file used to be, open Time Machine, scroll back to a time before the move, and restore it.
Prevent it next time
Move with a clear two-step flow: ⌘C, then Option+⌘V. See Cut and Paste on a Mac: Every Method for Text, Files and Folders.
Use Finder tabs, so you can see both folders. See How to Use FileCutPaste app to Cut and Paste Files, Folders and Images on Mac.
Keep Time Machine on.
FAQs
Can I undo a drag and drop on a Mac?
Yes, with ⌘Z straight away.
How do I find a file I moved?
Try Recents or Spotlight.
Does a move delete the original?
Only after the copy is complete. See Move vs Copy on a Mac: What Happens With External Drives, USB Sticks and Network Shares.