👋 We've unified all of GitHub's product documentation in one place! Check out the content for REST API, GraphQL API, and Developers. Learn more on the GitHub blog.

Reverting a commit

You can revert a specific commit to remove its changes from your branch.

Were you able to find what you were looking for?

When you revert to a previous commit, the revert is also a commit. The original commit also remains in the repository's history.

Tip: When you revert multiple commits, it's best to revert in order from newest to oldest. If you revert commits in a different order, you may see merge conflicts.

  1. Click History.
    The history tab selected in the sidebar
  2. Right-click the commit you want to revert and click Revert This Commit.
    The Revert option above the diff view
  1. Click History.
    The history tab selected in the sidebar
  2. Right-click the commit you want to revert and click Revert This Commit.
    The Revert option above the diff view

Were you able to find what you were looking for?

Ask a human

Can't find what you're looking for?

Contact us