在github新建了一个空的库,然后到本地文件夹下,git init了一下,将remote和本地的关联起来了,然后git pull了一下,本地的项目源码全没了,如何恢复,求大神搭救,万分感激!!!
PHP中文网2017-04-28 09:06:35
git reflog
: View commit historygit reset --hard id
: id is the corresponding history found above, give it a try?PHP中文网2017-04-28 09:06:35
Your operation will not cause file loss, please review your operation steps
When git pull has untracked files locally, if there are no conflicts, these files will be ignored and will not cause file loss.
If there is a conflict, the pull will fail and will not cause file loss
PHP中文网2017-04-28 09:06:35
I asked on stackoverflow and used git fsck --lost-found
,然后文件会恢复在.git/lost-found/other
inside, but the directory structure and file name cannot be restored