search

Home  >  Q&A  >  body text

git reset accidentally deletes local uncommitted files

I want to undo the git add operation, so git reset --hard HEAD

The result returns to the position of the last submission. What should I do to retrieve uncommitted modified files...


Also next time I will use git rm --cached, shame (:

伊谢尔伦伊谢尔伦2845 days ago698

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-05-02 09:38:39

    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...

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-02 09:38:39

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

    reply
    0
  • Cancelreply