Get Mystery Box with random crypto!

How To Undo Last Git Commit 1) The easiest way to undo the la | ProgerHub

How To Undo Last Git Commit

1) The easiest way to undo the last Git commit is to execute the “git reset” command with the “–soft” option that will preserve changes done to your files. You have to specify the commit to undo which is “HEAD~1” in this case.

git reset --soft HEAD~1

2
) In order to undo the last commit and discard all changes in the working directory and index, execute the “git reset” command with the “–hard” option and specify the commit before HEAD (“HEAD~1”).

git reset --hard HEAD~1


Read More