Skip to content

Reset to a specific commit

Maybe you or a co-worker seriously screwed up the repository with a commit, or even local changes and you want to reset to a commit that was made before. You can do that by performing a hard reset like this (Replace with the hash of the commit you want to reset to):

git reset --hard <commit-hash>

After the reset is completed, you can perform a force-push to remove a faulty commit, if needed.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.