在我的git状态中,我看到了这个
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
如何将文件重置为当前暂存的更改并仅丢弃非暂存的更改。
答案 0 :(得分:2)
您可以使用checkout命令执行此操作,就像那样:
git checkout file1
git checkout file4
希望这个帮助