git rm - How to revert a "git rm -r ."? -


I accidentally said git rm -r How can I recover from this?

I did not.

I think all the files were marked for deletion and were also physically removed from my local checkout.

Edit: I could return the previous commit (if I knew the order). But it would be much better if I just got to git rm -r could be undone. Because I'm not really sure what I did after the last commitment and git rm -r Before .

  git reset HEAD  

should do this . If you do not have any unclassified changes that you care about, then

git reset - hard head

forcibly all your final commitment Some should be reset. If you can make any changes without making changes, but the first command does not work, then save your quoted changes with git stash :

  git stash Git reset - hard head git hiding pop  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -