Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Laura Coursen <lecoursen@github.com>
27 lines
1.5 KiB
Markdown
27 lines
1.5 KiB
Markdown
---
|
|
title: Undoing a commit in GitHub Desktop
|
|
shortTitle: Undoing a commit
|
|
intro: 'You can undo a commit before you have pushed it to the remote branch.'
|
|
versions:
|
|
feature: desktop
|
|
---
|
|
|
|
## About undoing a commit
|
|
|
|
If you made a mistake in your changes, you can undo a commit in {% data variables.product.prodname_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, until you reach a commit that has already been pushed to the remote repository. To undo a pushed commit without disrupting commit history for other contributors, you can revert the commit. For more information, see "[AUTOTITLE](/desktop/managing-commits/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 "[AUTOTITLE](/desktop/managing-commits/amending-a-commit-in-github-desktop)."
|
|
|
|
## Undoing a commit
|
|
|
|
1. In the left sidebar, ensure you are on the **Changes** tab.
|
|
1. At the bottom of the sidebar, click **Undo**.
|
|
|
|

|
|
|
|
## Further reading
|
|
|
|
- "[AUTOTITLE](/desktop/managing-commits/options-for-managing-commits-in-github-desktop)"
|