簡體   English   中英

我如何退出我所做但尚未在我的 GITHUB 分支中提交的一些更改

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM