git - 如何恢复Initial commit之前的源文件
PHPz
PHPz 2017-04-28 09:04:35
0
3
765

在github新建了一个空的库,然后到本地文件夹下,git init了一下,将remote和本地的关联起来了,然后git pull了一下,本地的项目源码全没了,如何恢复,求大神搭救,万分感激!!!

PHPz
PHPz

学习是最好的投资!

reply all(3)
Ty80
  • git reflog: View commit history
  • git reset --hard id: id is the corresponding history found above, give it a try?
Ty80

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

洪涛

I asked on stackoverflow and used git fsck --lost-found,然后文件会恢复在.git/lost-found/otherinside, but the directory structure and file name cannot be restored

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template