Revert commit on Website #60023
Select Topic AreaQuestion BodyHello there! |
Replies: 9 comments 25 replies
|
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. You will now see a button that says "Revert changes in commit." |
|
Thanks for the tips.
|
|
GitHub’s website lacks a revert button, so you’ll need to manually restore files, had to do the same on Pearl Lemon Web’s repo once. |
|
This is incredibly stupid. GitHub, why must us simple folk constantly have to teach you what is good UI/UX? |
|
My use case is that I have a huge repository that takes hours to download and I just want to revert a commit in it. I can't use the terminal for that because then I would have to run git clone which takes hours, so I tried to install GitHub Desktop, but that didn't help because I would have had to clone the repository there also. It seems like the quickest in my case is to just manually copy-paste the old code into a new commit on the website. |
|
October 2025 and we still can't revert commits from the WebUI? Cmon github |
|
Hi, I know this is an old discussion but hoping someone might have some updated info here. Our situation is a bit more nuanced. One of the team raised a PR against our main branch instead of a release branch accidentally and no one noticed until it was too late. Consequently a massive amount of changes were prematurely merged to it. What we want to do it RESET the head back to just before that commit. Due to company enforced policies, we cannot commit directly to main without a PR (kind of sensible). What many people here seem to be missing is that a REVERT can often NOT be what you want to do. In my experience, way more often than not, that is the case. In this case, if we were to revert the commit, the following would happen:
So far, the team has been blocked from interacting with the main branch at all, so no issue with anyone having local branches with the errant commit in them. It would be ideal if GitHub had some function to be able to do this in the site itself as it is NOT the same scenario as committing directly to the main branch that we are trying to block NOR is it the same as doing a revert which is ABSOLUTELY NOT what we want to do here. |





Not as of this moment. Github doesn't have a web API call to do it, so it's not possible. See their API documentation to check what's possible.