Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to revert a commit through GitHub's web interface

I'm teaching a HTML class on Chromebooks. We're using GitHub for both revision control and I'd like to show my students how to revert a commit. Since we don't have shell access on the Chromebooks I was hoping to find a way to do this online, through the GitHub website. Is that possible? I'm starting to think it might not be.

like image 232
dlu Avatar asked Sep 26 '22 10:09

dlu


1 Answers

You can't. GitHub does not have a web API call to do this.

The full API can be found here.


What can you do?

Since we don't have shell access on the Chromebooks...

You can always revert locally and then push your code with -f to force the code to be pushed, but since you don't have command line to do it you will need to manually revert your code and commit the "old" code back.

If you do have the option to use a CLI, rather than the GitHub website, take a look at this answer. It will be very helpful for you. It describes in detail how to revert commits in various ways using the CLI.

How to move HEAD back to a previous location? (Detached head)

like image 171
CodeWizard Avatar answered Sep 29 '22 06:09

CodeWizard