Skip to content

Instantly share code, notes, and snippets.

@zhoudaxia233
Last active May 23, 2019 15:04
Show Gist options
  • Save zhoudaxia233/26a896092aeab27b95c1afa1f6ab2599 to your computer and use it in GitHub Desktop.
Save zhoudaxia233/26a896092aeab27b95c1afa1f6ab2599 to your computer and use it in GitHub Desktop.
Undo a commit
  1. undo the commits from the local repository (it means you haven't git push them)

1.1 If you only want to add more changes to the previous commit, or change the commit message

git reset --soft HEAD~

1.2 If you also want to un-add the files which you added using git add command

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