0

在我的 git status 我看到这个

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

modified: file1
modified: file2
modified: file4

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: file1
modified: file4

如何将文件重置为当前的暂存更改并仅丢弃非暂存更改。

4

1 回答 1

2

您可以使用 checkout 命令执行此操作,就像这样:

git checkout file1
git checkout file4

希望这有帮助

于 2015-05-28T17:36:46.550 回答