是否有可能通过GitHub的Web界面恢复提交 [英] Is it possible to revert a commit through GitHub's web interface

查看:106
本文介绍了是否有可能通过GitHub的Web界面恢复提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Chromebook上教授HTML课程。我们使用GitHub进行版本控制,并且希望向学生展示如何恢复提交。由于我们没有在Chromebook上使用shell,因此我希望能够通过GitHub网站在线查找方法。那可能吗?我开始认为它可能不是。

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.

推荐答案

你不能。 GitHub没有一个web API调用来做到这一点。

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

可以找到完整的API here

The full API can be found here.


由于我们在Chromebook上没有shell访问权限......

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

您可以随时在本地恢复,然后使用 -f 推送您的代码以强制推送代码,但由于您没有命令行来执行此操作您需要手动恢复您的代码并提交旧代码。

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.

如果您可以选择使用CLI而不是GitHub网站,看看这个答案。这对你非常有帮助。它详细描述了如何使用CLI以各种方式还原提交。

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.

如何将HEAD移回到以前的位置? (分离头)

这篇关于是否有可能通过GitHub的Web界面恢复提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆