[英]How can I back out of some changes I made but didn't yet commit in my GITHUB branch
Here's the output from > git status这是> git status 的输出
MacBook:Ja.git alan$ git status
On branch alan-1
Your branch is up to date with 'origin/alan-1'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: Ja/App/App.xaml.cs
no changes added to commit (use "git add" and/or "git commit -a")
MacBook:Ja.git alan$
I made changes to the App.xaml.cs but didn't yet commit.我对 App.xaml.cs 进行了更改,但尚未提交。
Not sure if it makes any difference but I am using Visual Studio as my front-end and I also have access to git on the command line.不确定它是否有任何区别,但我使用 Visual Studio 作为我的前端,我也可以在命令行上访问 git。
How can I back out of the changes that I made and restore App.xaml.cs to the way it was before I edited it?如何退出我所做的更改并将 App.xaml.cs 恢复到我编辑它之前的状态?
Can I do it from the Visual Studio menu here:我可以从这里的 Visual Studio 菜单执行此操作吗:
How can I back out of the changes that I made and restore App.xaml.cs to the way it was before I edited it?如何退出我所做的更改并将 App.xaml.cs 恢复到我编辑它之前的状态?
Yes, git checkout -- filename
has the same effect as "revert" command from the menu.是的, git checkout -- filename
与菜单中的“revert”命令具有相同的效果。
Instead of going to main menu, you can also locate the Changes window in Visual Studio (Team Explorer --> Changes) and revert from there.除了转到主菜单,您还可以在 Visual Studio(团队资源管理器 --> 更改)中找到“更改”窗口并从那里恢复。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.