Skip to content

Instantly share code, notes, and snippets.

@hugoduraes
Last active February 12, 2016 20:11
Show Gist options
  • Save hugoduraes/24305c667c47580b4493 to your computer and use it in GitHub Desktop.
Save hugoduraes/24305c667c47580b4493 to your computer and use it in GitHub Desktop.

If you have committed junk but not pushed

# deletes the commit but it will leave all your changed files "Changes to be committed"
git reset --soft HEAD~1

# deletes the commit and gets rid of any changes to tracked files
git reset --hard HEAD~1

If you already pushed and someone pulled

git revert HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment