选自stackoverflow

git diff <commit> <commit> filename

例如,比较HEAD和前一个commit之间的差别:

git diff HEAD~1 HEAD filename