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):

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

[sc name=”src” url=”https://stackoverflow.com/questions/40250601/github-reset-to-previous-commit” ]

Be First to Comment

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.