Answers for "git hard reset to last commit"

CSS
0

git reset to latest commit

git reset --hard HEAD~0
will go to latest commit.


git reset --hard HEAD~1
will go to last but one commit.

Note:  Be careful while running this command. it can't be irreversible
Posted by: Guest on June-29-2021
5

git hard reset to commit

git reset --hard HEAD
Posted by: Guest on May-12-2020
0

git move back one commit

# This will detach your HEAD, that is, leave you with no branch checked out:
git checkout 0d1d7fc32
Posted by: Guest on November-06-2020

Browse Popular Code Answers by Language