git rebase last 2 commits code example
Example 1: git squash last 2 commits
git rebase -i HEAD~2
Example 2: squash 3 commit
$ git rebase -i HEAD~3
Example 3: git revert last 2 commits
$ git revert --no-commit D
$ git revert --no-commit C
$ git revert --no-commit B
$ git commit -m "the commit message"