2017-04-11 40 views
-1

我有一个文件的方式我想要它,并提交它,然后对其进行了更改,并没有提交。如何恢复更改为未被接受的文件

没有远程关联的回购。

如何恢复未提交的最新更改?

+0

可能的杜[使用Git重置或恢复特定文件到特定修订?](http://stackoverflow.com/questions/215718/reset-or-revert-a-specific-file-to-a-specific-revision-使用-git) –

+0

可能重复[git撤消所有未提交的更改](http://stackoverflow.com/questions/14075581/git-undo-all-uncommitted-changes) – 1615903

回答

0
git reset HEAD --hard 

git checkout -- <file path + name> 

git-reset
重置电流HEAD为指定的状态

enter image description here

+1

谢谢!酷可视化。我将研究'reset head --hard'和'checkout - '之间的差异。我需要输入实际的'<' and '>'吗? –