回滚GitHub Desktop(或Windows的Github)中未提交的更改 [英] Rollback uncommitted changes in GitHub Desktop (or Github for Windows)

查看:629
本文介绍了回滚GitHub Desktop(或Windows的Github)中未提交的更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Github Desktop (以前称为

I'm using Github Desktop (previously called GitHub for Windows) and I made a bunch of changes to my local files. It became such a mess that I decided I just want to rollback my local files to where they were the last time I made a commit. I haven't committed the new changes - I just want to get rid of them. How can I do this?

推荐答案

与时俱进,适用于Windows的Github进行了重大改造,因此,这里有一个新答案.现在称为 Github Desktop

In keeping up with the times, Github for Windows has had a huge makeover, so here's a new answer. It's now called Github Desktop and the version numbers have started back at v1.0.0. So if you're running Github Desktop v1 then your UI is going to look a little different.

但是,此超级方便,始终隐藏的小功能仍然存在.

This super-handy, always-hidden little feature, however, is still there.

首先,在黑色区域的最左侧下拉列表中选择您的存储库.确保然后选择显示更改"的选项卡.现在,您可以在包含"{#}个已更改文件"的矩形中的任意位置单击鼠标右键,然后会出现一个弹出窗口,显示放弃所有更改...".你是最后一次提交.

First, select your repository in the far-left dropdown in the black area. Make sure you then select the tab that says "Changes". Now you can right-click anywhere in the rectangle that contains "{#} changed files" and you'll get a pop-up that says "Discard all changes..." Click that and, presto, you're back to where you were the last time you made a commit.

奖金:您也可以右键单击任何已更改的文件,以弹出一个弹出式窗口,使您可以仅对该文件放弃更改...".单击该按钮,只有该文件将恢复为上次提交时的位置.

Bonus: You can also right-click any of the changed files to get a pop-up that will enable you to "Discard changes..." for only that file. Click that and only that file will revert back to where it was at the last commit.

Github桌面文档现在包含有关如何

The Github Desktop documentation now includes information on how to discard changes. It is, however, incorrect! When you right-click an individual file the pop-up does not give the option to "Discard all changes..." as their screen shot seems to indicate. To discard all changes you need to do as I describe above.

这篇关于回滚GitHub Desktop(或Windows的Github)中未提交的更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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