我对许多文件进行了更改,但尚未提交。我如何撤出所有更改?

时间:2019-02-26 10:55:36

标签: git github

这是gitstatus向我显示的内容:

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/Views/DictionaryTab/DictionaryTabPage.xaml.cs
    modified:   Ja/Views/HomeTab/HomeTabPage.xaml
    modified:   Ja/Views/HomeTab/HomeTabPage.xaml.cs
    modified:   Ja/Views/MainPage.xaml.cs
    modified:   Ja/Views/SettingsTab/SettingsTabPage.xaml.cs
    modified:   Ja/Views/SettingsTab/Subscriptions.cs

no changes added to commit (use "git add" and/or "git commit -a")
MacBook:Ja.git alan$ 

将感谢您的建议,因为重要的是我只是回到更改这些文件之前。

1 个答案:

答案 0 :(得分:1)

git checkout --name_of_file允许您恢复原始版本