git reset 误删本地未提交文件
伊谢尔伦
伊谢尔伦 2017-05-02 09:36:39
0
2
612

我想撤销git add操作,所以git reset --hard HEAD

结果回到了上一次提交的位置。我该怎么做才能找回未提交的修改文件...


另外下次我会用git rm --cached,羞愧 (:

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(2)
Ty80

You can try git reflogCommand:

If you accidentally use git commit --amend as git commit to overwrite the current commit, or accidentally destroy the current commit (reset --hard). All can be restored through git reflog. https://github.com/hokein/Wik...

phpcn_u1582

git reset also has other parameters, such as soft|mixed, you can take a look

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!