git reset to commit
# reset to specefic commit
git reset --hard <commit id>
# to go back one step
git reset --hard HEAD~1
# note: use --soft to keep file changes
git reset to commit
# reset to specefic commit
git reset --hard <commit id>
# to go back one step
git reset --hard HEAD~1
# note: use --soft to keep file changes
undo git reset HEAD~1
# if you would like to move back the head by one position you could do:
git reset HEAD~
# if you want to move multiple positions at once e.g 3 times back type:
git reset HEAD@{3}
git how to roll back to a commit
//git use a new commit to replace an old commit,commit moves foward not backward
git revert <commit hash>
//Git goes back one spot on the log,undone this commit and go backward one commit:
git reset HEAD~1
//Git looks for and rolls back to a certain file:
git checkout commit-hash-here -- file/location/and/name
reset to commit
# rollback to commit state
git revert --no-commit 0766c053..HEAD
git commit
reset to commit
# This will detach your HEAD, that is, leave you with no branch checked out:
git checkout 0d1d7fc32
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us