squash multiple commits to take latest change code example Example: git squash last 2 commits git rebase -i HEAD~2