2017-04-11 81 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 '>'嗎? –