Undoing a commit in GitHub Desktop - GitHub Docs
Skip to main content

Undoing a commit in GitHub Desktop

You can undo a commit before you have pushed it to the remote branch.

About undoing a commit

If you made a mistake in your changes, you can undo a commit in GitHub Desktop. Undoing a commit restores the changes in the commit to your working directory and resets the branch to the previous commit, so you can make further changes before committing again.

You can undo multiple sequential commits up to a commit that has already been pushed to the remote repository by selecting a previous commit and using the "reset to commit" option. For more information, see Resetting to a commit in GitHub Desktop. To undo a pushed commit without disrupting 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.

Undoing a commit

  1. In the left sidebar, ensure you are on the Changes tab.

  2. At the bottom of the sidebar, click Undo.

    Screenshot of part of the "Changes" tab. Next to the commit message, a button, labeled "Undo", is highlighted with an orange outline.

Further reading

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.