Answers for "how to checkout a previous commit"

3

git tag a previous commit

git tag -a v1.2 9fceb02 -m "Message here"
Posted by: Guest on June-11-2020
0

git checkout previous commit

git reset --hard HEAD~10
To rollback 10 commits back:
Posted by: Guest on October-30-2020
2

after checking out a previous commit go back to latest commit

git checkout <commit hash>	# go to previous commit
git revert <commit hash>  	# revert action of going to previous commit
Posted by: Guest on July-27-2020
0

git pull from previous commit

git checkout -b old-state 0d1d7fc32
Posted by: Guest on July-18-2020
0

git checkout previous commit

$ git reset --hard <commit_id>
Posted by: Guest on April-19-2021
0

git checkout previous commit HEAD

git checkout <commit_id>
git checkout -b <new branch> <commit_id>
git checkout HEAD~X // x is the number of commits to go back
Posted by: Guest on March-08-2021

Code answers related to "how to checkout a previous commit"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language