git merge last 3 local commits to one code example Example: git squash last 2 commits git rebase -i HEAD~2