🌐
GitHub
docs.github.com › en › desktop › managing-commits › reverting-a-commit-in-github-desktop
Reverting a commit in GitHub Desktop - GitHub Docs
... When you revert to a previous commit, the revert is also a commit. The original commit also remains in the repository's history. ... When you revert multiple commits, it's best to revert in order from newest to oldest.
🌐
GitHub
docs.github.com › en › desktop › managing-commits › undoing-a-commit-in-github-desktop
Undoing a commit in GitHub Desktop - GitHub Docs
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.
Discussions

Revert changes based on multiple commit selection
The feature request GitHub Desktop shows the diff when selecting multiple commits, it would be great if you could right click a selection of commits and reverse the entire net diff. Proposed solution Currenty, if you have to revert multi... More on github.com
🌐 github.com
0
August 24, 2023
How can I revert multiple Git commits? - Stack Overflow
Also, git revert --no-commit B^..D. Harder to remember but let hashes to type! 2025-10-30T03:44:48.027Z+00:00 ... @welldan97: Thanks for a comment. When writing this answer git revert didn't accept multiple commits; it is quite new addition. More on stackoverflow.com
🌐 stackoverflow.com
Revert commit on Website
Select Topic Area Question Body Hello there! I'm beginner on GitHub, and can't resolve one problem - on desktop version i can "Revert changes in commit" in history without problem... More on github.com
🌐 github.com
8
18
git - Going back to a previous commit in Github Desktop - Stack Overflow
I am trying to use GitHub Desktop (i.e. the GUI application - NOT command line) to go back to a previous commit (on the same branch). Something that I would have thought is a core feature, since it's the primary reason for using source control in the first place. I can see that it's possible to revert ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
GitHub
github.com › github › docs › blob › main › content › desktop › managing-commits › reverting-a-commit-in-github-desktop.md
docs/content/desktop/managing-commits/reverting-a-commit-in-github-desktop.md at main · github/docs
When you revert to a previous commit, the revert is also a commit. The original commit also remains in the repository's history. ... When you revert multiple commits, it's best to revert in order from newest to oldest.
Author   github
🌐
LightNode
go.lightnode.com › tech › rollback-commit-github
How to Rollback Commits in GitHub: A Complete Developer's Guide
July 24, 2025 - Here are the most important commands for rolling back commits on GitHub: # Revert a single commit (safe for shared repos) git revert <commit-hash> # Revert multiple commits git revert <oldest-hash>..<newest-hash> # Revert without auto-committing ...
🌐
Medium
pavolkutaj.medium.com › revert-changes-in-the-commit-with-github-desktop-e08854c27b8
Revert Changes in the Commit with GitHub Desktop - Pavol Z. Kutaj - Medium
January 29, 2021 - The concern is documenting the GUI approach to a simple revert of a commit. I could not come up with an elegant git CLI solution, the easiest is to use the GUI of GitHub Desktop
🌐
Jcszamosi
jcszamosi.github.io › mcmaster_swc_git_gui › 06-history
Version Control with Git: Exploring History
December 13, 2017 - If you had saved, but uncommitted ... commit action. What this means is that in order to revert back multiple commits, you must revert them one at a time, starting with the most recent....
🌐
YouTube
youtube.com › exploi.t.
Revert Commits & Merge Conflicts | GitHub Desktop - YouTube
In this video, we'll learn how to Revert Commits, solve Merge Conflicts and delete repositories using the GitHub Desktop easily and how it works in a better ...
Published   September 20, 2020
Views   20K
Find elsewhere
🌐
GitHub
github.com › desktop › desktop › issues › 17278
Revert changes based on multiple commit selection · Issue #17278 · desktop/desktop
August 24, 2023 - GitHub Desktop shows the diff when ... if you have to revert multiple commits, you have to revert each commit individually and make sure you are going from newest to oldest....
Author   desktop
Top answer
1 of 16
2243

Expanding what I wrote in a comment

The general rule is that you should not rewrite (change) history that you have published, because somebody might have based their work on it. If you rewrite (change) history, you would make problems with merging their changes and with updating for them.

So the solution is to create a new commit which reverts changes that you want to get rid of. You can do this using git revert command.

You have the following situation:

A <-- B  <-- C <-- D                                  <-- master <-- HEAD

(arrows here refers to the direction of the pointer: the "parent" reference in the case of commits, the top commit in the case of branch head (branch ref), and the name of branch in the case of HEAD reference).

What you need to create is the following:

A <-- B  <-- C <-- D <-- [(BCD)-1]                   <-- master <-- HEAD

where [(BCD)^-1] means the commit that reverts changes in commits B, C, D. Mathematics tells us that (BCD)-1 = D-1 C-1 B-1, so you can get the required situation using the following commands:

$ git revert --no-commit D
$ git revert --no-commit C
$ git revert --no-commit B
$ git commit -m "the commit message for all of them"

Works for everything except merge commits.


Alternate solution would be to checkout contents of commit A, and commit this state. Also works with merge commits. Added files will not be deleted, however. If you have any local changes git stash them first:

$ git checkout -f A -- . # checkout that revision over the top of local files
$ git commit -a

Then you would have the following situation:

A <-- B  <-- C <-- D <-- A'                       <-- master <-- HEAD

The commit A' has the same contents as commit A, but is a different commit (commit message, parents, commit date).


Alternate solution by Jeff Ferland, modified by Charles Bailey builds upon the same idea, but uses git reset. Here it is slightly modified, this way WORKS FOR EVERYTHING:

$ git reset --hard A
$ git reset --soft D # (or ORIG_HEAD or @{1} [previous location of HEAD]), all of which are D
$ git commit
2 of 16
821

Clean way which I found useful

git revert --no-commit HEAD~3..
git commit -m "your message regarding reverting the multiple commits"

This command reverts last 3 commits with only one commit.

Also doesn't rewrite history, so doesn't require a force push.

The .. helps create a range. Meaning HEAD~3.. is the same as HEAD~3..HEAD

🌐
GitHub
docs.github.com › en › enterprise-server@3.10 › desktop › managing-commits › reverting-a-commit-in-github-desktop
Reverting a commit in GitHub Desktop - GitHub Enterprise Server 3.10 Docs
When you revert to a previous commit, the revert is also a commit. The original commit also remains in the repository's history. ... When you revert multiple commits, it's best to revert in order from newest to oldest.
🌐
TMS Outsource
tms-outsource.com › home › how to revert to a previous commit in github
How to Revert to a Previous Commit in GitHub - TMS Outsource
December 14, 2025 - To revert using GitHub Desktop, click History in the left sidebar, right-click the target commit, and select “Revert changes in commit” which creates a new commit that undoes the selected changes without command line interaction.
🌐
GitHub
docs.github.com › en › enterprise-cloud@latest › desktop › managing-commits › reverting-a-commit-in-github-desktop
Reverting a commit in GitHub Desktop - GitHub Enterprise Cloud Docs
... When you revert to a previous commit, the revert is also a commit. The original commit also remains in the repository's history. ... When you revert multiple commits, it's best to revert in order from newest to oldest.
🌐
GitHub
docs.github.com › en › desktop › managing-commits
Managing commits - GitHub Docs
You can use GitHub Desktop to amend, cherry-pick, reorder, revert, reset, and squash commits.
🌐
GitHub
docs.github.com › en › desktop › managing-commits › options-for-managing-commits-in-github-desktop
Options for managing commits in GitHub Desktop - GitHub Docs
Often, it is difficult to follow these best practices perfectly at the point where you're making changes. You might realize you need to undo the changes in a commit you've made, edit a commit message, or reorder your commits to tell a clearer story. With GitHub Desktop, you can manage your commit history directly from the user interface.
🌐
GitHub
gist.github.com › rponte › 8a7c95232f469a4b6fd17dfedb8b90b4
Git: reverting a range of commits · GitHub
Save rponte/8a7c95232f469a4b6fd17dfedb8b90b4 to your computer and use it in GitHub Desktop. Download ZIP · Git: reverting a range of commits · Raw · git-revert-multiple-commits.sh · This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below.
🌐
GitHub
github.com › orgs › community › discussions › 60023
Revert commit on Website · community · Discussion #60023
Hey. If you don't want to revert a commit using the console, the easiest way is to go to Github Desktop (which is UI-based rather than terminal), set current repo to the specific repo, click on history, and right click on a commit.
🌐
Reddit
reddit.com › r/github › how to go back to a state at a commit?
r/github on Reddit: how to go back to a state at a commit?
January 5, 2024 -

I have GitHub Desktop and I have been making regular commits. Now a bug was introduced and I want to go back and get the whole project as it was in time at a previous commit.

How to do that is not entirely intuitive. How do you go back to a previous state of the entire project at the point of a single commit?

There are no local changes according to Github Desktop....

no changes

The commit that I want to go back to is the 3rd commit down on the left. I figure that (according to their instructions) I would revert the two latest commits and I'd be back where I want to be.

a simple plan

But Github protets and claims there are changes.....

only there aren't any changes

But, there aren't any changes.

WTF Github?

I'm not worried about the code......

I'm just irritated that a versioning system so widely used would be so poorly designed.

Top answer
1 of 3
4
Copy the git sha of the commit you wanna go back to. Checkout that sha with git checkout. If it’s not too far back you could do a git reset head. Come to think of it you might be able to git restore to just restore everything to that sha. Anyhow after all that you would need to force push to overwrite the branch. Now that I answered your question let me ask the real question. Why not just fix the bug with a new commit? Why undo all the work you have already done?
2 of 3
1
Sounds like you were just confused with terminology, which is entirely understandable. Git involves a lot of words that mean very specific things within the context of Git, but are more flexible in ordinary language. In this case, you thought "revert" would do what you wanted, but what that actually means is to permanently revert something going forward. You use it when you decide that some changes you made before are inappropriate and should be undone (and they were in a shared branch that you want to keep using, so you can't merely ignore the last few commits; you need the reversion to explicitly exist in history). What you really want is to "check out" an old commit. Think of it like checking out a book at your local library. You want to read it for a while, and then return to what you were doing before. This is a read-only operation in terms of version history; you're not modifying history by adding a new event to it the way that revision does. You're only browsing through history, observing what it looked like at various moments by modifying only your local working copy.