Skip to content

Instantly share code, notes, and snippets.

@awd-git
Last active January 19, 2016 23:02
Show Gist options
  • Save awd-git/f8ca01a4affe5d93d916 to your computer and use it in GitHub Desktop.
Save awd-git/f8ca01a4affe5d93d916 to your computer and use it in GitHub Desktop.
// HEAD~2 squashes the last two commits
// HEAD~3 the last three
// ... and so on
// this is the example for last three
git reset --soft HEAD~3 && git commit
// to push everything to origin, i.e. remote on github.com
git push origin [branch-name] --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment