Answers for "undo local commit"

16

git undo commit

# Uncommit the changes
git reset --soft HEAD~1

# Completely delete the changes
git reset --hard HEAD~1
Posted by: Guest on September-04-2020
7

undo local commit

$ git reset --soft HEAD~1
Posted by: Guest on April-09-2020
0

revert local commit

$ git reset --hard HEAD~1
Posted by: Guest on March-03-2020
1

Undo git commit

$ git commit -m "Something terribly misguided" # (0: Your Accident)
$ git reset HEAD~                              # (1)
[ edit files as necessary ]                    # (2)
$ git add .                                    # (3)
$ git commit -c ORIG_HEAD                      # (4)
Posted by: Guest on August-23-2021
0

how to undo a local commit

git reset HEAD~1
Posted by: Guest on August-01-2021
0

undo git commit

$ git reset HEAD^
Posted by: Guest on September-08-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language