Skip to main content

This version of GitHub Enterprise Server was discontinued on 2024-09-25. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise Server. For help with the upgrade, contact GitHub Enterprise support.

Resetting to a commit in GitHub Desktop

You can reset to any commit up to the one that was last pushed to the remote branch.

About resetting to a commit

If you made a series of commits and want to fix a mistake you made prior to the most recent commit, you can use "reset to commit" in GitHub Desktop to reset the changes in those commits. Resetting to a commit restores the changes in the subsequent commits to your working directory and resets the branch to the selected commit. You can then make changes before committing again, or you can discard changes that you don't want to keep. For more information, see "Committing and reviewing changes to your project in GitHub Desktop."

You can reset to commit up to the most recent commit that has already been pushed to the remote repository. To undo a pushed commit without disrupting the commit history for other contributors, you can revert the commit. For more information, see "Reverting a commit in GitHub Desktop."

If you want to edit your most recent commit message, or combine new changes with your most recent commit, you can amend a commit. For more information, see "Amending a commit in GitHub Desktop."

Resetting to a commit

  1. In the left sidebar, click History.

    Screenshot of the "History" tab in the sidebar. Above a list of commits, the tab button, labeled "History", is highlighted with an orange outline.

  2. Right-click on the commit you would like to reset to and select Reset to commit.

Further reading