$git log
commit-1(new/latest/recent commit)
commit-2
commit-3
commit-4
*
*
commit-n(first commit)
$git diff commit-2 commit-1
display's all changes between commit-2 to commit-1 (patch of commit-1 alone & equivalent to
git diff HEAD~1 HEAD
)
similarly $git diff commit-4 commit-1
display's all changes between commit-4 to commit-1 (patch of commit-1, commit-2 & commit-3 together. Equivalent to
git diff HEAD~3 HEAD
)
$git diff commit-1 commit-2
By changing order commit ID's it is possible to get
revert patch
. ("$git diff commit-1 commit-2 > revert_patch_of_commit-1.diff")