Git + Rails: How to restore files deleted with “git rm -r”?

前端 未结 3 867
耶瑟儿~
耶瑟儿~ 2021-02-05 18:29

I deleted my db folder in a rails application in with git rm -r

I\'ve tried

git reset HEAD

and

git reset --hard HEAD
<         


        
3条回答
  •  别那么骄傲
    2021-02-05 18:58

    You can checkout individual files from your last commit or index.

    git checkout db/* checks out everything under db from the index

    git checkout master db/* checks out everything under db from the head of the master branch

    you may be able to salvage most of your stuff that way

    read more: git help checkout

提交回复
热议问题