I currently have three modified files in my working directory.
(我目前在工作目录中有三个修改过的文件。)
However I want one of them to be reset to the HEAD status.(但是我希望其中一个重置为HEAD状态。)
In SVN I'd use svn revert <filename>
(followed by svn update <filename>
if needed) but in git I should use git reset --hard
.
(在SVN中,我使用svn revert <filename>
(如果需要,然后是svn update <filename>
)但是在git中我应该使用git reset --hard
。)
(但是,此命令无法在单个文件上运行。)
Is there any way in git to discard a single file changes and overwrite it with a fresh HEAD copy?
(有没有办法在git中丢弃单个文件更改并用新的HEAD副本覆盖它?)
ask by Emiliano translate from so