撤消项目的git pull

问题描述 投票:0回答:1

我通过在本地项目的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 git-pull pull
1个回答
1
投票

这对我有用。

首先,您必须找出git pull之前的commit-hash。 (使用git log非常容易)

然后,您可以将本地存储回退到上一次提交的状态。例如(commit-hash必须与您的一起调整)

git reset --hard abc1234a

您也可以将git reflogreset一起使用git reset --hard HEAD@{1}来查找本地存储库>

© www.soinside.com 2019 - 2024. All rights reserved.