git diff between two files in different commits code example
Example 1: git diff two commits one file
$ git diff HEAD^^ HEAD main.c
$ # show diff between HEAD(current commit) and HEAD^^(two commits back) for main.c
Example 2: how to compare two commits in git
$ git diff 012345..abcdef