Getting all versions of a file from a Time Machine backup

If you are a bit familiar with the terminal, it is quite easy. Open the terminal and cd to the location of your backups on your backup hard drive. Then, you copy all versions of the folder you are interested in into a new folder with rsync.

I'm making up an example where you want to copy all versions of the folder /Users/peter/Documents/thesis/ into a new folder ~/all_my_versions that is located in your home folder.

You will have to adapt the paths to your system, e.g. by replacing Macintosh\ HD with the name of your harddrive.

# create new folder
mkdir ~/all_my_versions/
# change directory to your backups
cd /Volumes/Backup_HD/Backups.backupdb/My_MacBook_Pro/
# run for loop to copy all folders into newly created directory
for F in *
 do
  rsync -avz $F/Macintosh\ HD/Users/peter/Documents/thesis ~/all_my_versions/$F
 done

In the end, the folder ~/all_my_versions will contain several subfolders, whose names are the backup dates and times:

2015-10-19-113849/
2015-10-28-111812/
2015-11-04-104802/