To compare a file with a certain commit that is not the current HEAD, I call git log, note the commit hash and then call git diff <hash> filename.
Is there a way to use the diff command like this: git diff -<x_commits_back> filename and compare the file with a version from x versions ago?
Thank you
Yes, you can use:
Replace
Xas appropriate. Note that it follows the first parent of merge commits.