Mac – How to find just deleted files in Time Machine

restoretime-machine

I am going through many old photographs on my Mac, deleting duplicates that have occurred for one reason or another. However, I realise that I may have deleted the wrong duplicate in some cases. I have deleted several hundred duplicate photos, across multiple folders.

I have my whole hard drive backed up in Time Machine. However I don't want to simply restore all the files in Time Machine for my photos folder since I have made some changes since doing the deletion that I want to keep. There are too many files involved to hunt for them in Time Machine individually.

Is there a way I can identify the files in a folder in Time Machine that do not exist in the current filesystem? And then a way to restore them.

I think the command line tool tmutil may be helpful but I am not experienced with this.

Best Answer

You can access time machine via a mount and then search and copy back to your machine using the automation technique of your choosing.

Here is a command you might find helpful. Replace A and B with your two directories. (see the SO answer here)

$ comm -23 <( find A -type f -printf '%f\n' | sort | uniq ) <( find B -type f -printf '%f\n' | sort | uniq )