Let's say I have a git, with a revision/commit with hash aaaaaaa in the past, which described a state with three files, a.txt, b.txt, and c.txt.
So, let's say there were more changes and commits, and current HEAD is at commit bbbbbbb, which has files a.txt, e.txt and f.txt - in other works, b.txt and c.txt from earlier have been deleted somewhere along the way.
Now, what I want to do, is search for a phrase in the files as they were in commit aaaaaa, and find in which file(s) it occurs.
Typically, I could do:
$ git checkout aaaaaaa $ grep -r 'phrase' . ... but, let's say I do not want to checkout, and I want to keep my current state at HEAD, that is commit bbbbbbb.
Is there a git command, that will allow me to grep through all the files as in commit aaaaaaa, while the checked out files are currently at HEAD of bbbbbbb - without having to checkout aaaaaaa?