git diff SHA1_COMMIT^ SHA1_COMMIT
With SHA1_COMMIT is the SHA1 commit you want to check.
What " git diff " will compare:
- pre-commit version referenced by these SHA1 and
- the commit referred to by SHA1.
As mentioned in the source code of the built-in diff.c , parsing:
static const char builtin_diff_usage[] = "git diff <options> <rev>{0,2} -- <path>*"
source share