git squash select commits code example Example: squash commits in git git reset --soft HEAD~3 && git commit