0
Q:

git undo commit

# KEEP CHANGES
git reset --soft HEAD~1

# REMOVE CHANGES
git reset --hard HEAD~1
8
# Uncommit the changes
git reset --soft HEAD~1

# Completely delete the changes
git reset --hard HEAD~1
4
$ git reset --soft HEAD~1
1
$ git reset --soft HEAD~1
3
git reset --soft HEAD~1
0
git reset <commitId>
# Exemple
git reset 5310517
-1
git reflog //to get commitID
git reset #commitID
0

New to Communities?

Join the community