[英]I made changes to a lot of files but didn't yet do a commit. How can I back out of all the changes?
[英]How can I back out of some changes I made but didn't yet commit in my GITHUB branch
這是> 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$
我對 App.xaml.cs 進行了更改,但尚未提交。
不確定它是否有任何區別,但我使用 Visual Studio 作為我的前端,我也可以在命令行上訪問 git。
如何退出我所做的更改並將 App.xaml.cs 恢復到我編輯它之前的狀態?
我可以從這里的 Visual Studio 菜單執行此操作嗎:
如何退出我所做的更改並將 App.xaml.cs 恢復到我編輯它之前的狀態?
是的, git checkout -- filename
與菜單中的“revert”命令具有相同的效果。
除了轉到主菜單,您還可以在 Visual Studio(團隊資源管理器 --> 更改)中找到“更改”窗口並從那里恢復。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.