我通过在本地项目的Github上错误地拉出一个项目来做,所以本地的所有项目都被删除并由github项目替换。
note: Github上的项目是Flutter项目,本地项目是Laravel one。
我如何找到我的Laravel项目?
此代码可能有助于解决此问题
$ git status .
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
test.sh
nothing added to commit but untracked files present (use "git add" to track)
这对我有用。
首先,您必须找出git pull
之前的commit-hash。 (使用git log
非常容易)
然后,您可以将本地存储回退到上一次提交的状态。例如(commit-hash必须与您的一起调整)
git reset --hard abc1234a
您也可以将git reflog
和reset
一起使用git reset --hard HEAD@{1}
来查找本地存储库>