Git bash说分支是((未知))

Git bash说分支是((未知)),git,repository,recover,Git,Repository,Recover,我只是使用Drupal的命令行工具Drush在我的站点的本地副本上测试核心更新。目前还不清楚更新是否成功,但它看起来确实破坏了我的git回购协议。我在WAMP堆栈上使用GitBash,它看起来如下所示: myuser@my-computer /c/wamp/www (d7upgrade) $ drush pm-upgrade drupal <.. whole bunch of drush output ..> myuser@my-computer /c/wamp/www ((unk

我只是使用Drupal的命令行工具Drush在我的站点的本地副本上测试核心更新。目前还不清楚更新是否成功,但它看起来确实破坏了我的git回购协议。我在WAMP堆栈上使用GitBash,它看起来如下所示:

myuser@my-computer /c/wamp/www (d7upgrade)
$ drush pm-upgrade drupal
<.. whole bunch of drush output ..>

myuser@my-computer /c/wamp/www ((unknown))
$ git status
fatal: Not a git repository (or any of the parent directories): .git
myuser@my-计算机/c/wamp/www(d7upgrade)
$drush pm升级drupal
myuser@my-计算机/c/wamp/www((未知))
$git状态
致命:不是git存储库(或任何父目录):.git
但是,我可以在/c/wamp/www中看到
.git
目录。它不是空的,事实上
.git\refs\heads
包含名为
master
d7upgrade
(我最新的分支)的文件


我可以恢复我的Git回购吗?

你有
.Git/HEAD
文件吗?如果删除了它,可能会导致您的症状。您可能会在gitbash会话中找到您需要的git reflog,尽管我不明白这里发生了什么。您是否在gitbash会话中定义了一个
git_目录
git_工作树
环境变量?@KevinBallard-当然,我已经失去了理智。有没有办法重现这个?我想知道还有什么被擦掉了。@doub1ejack:
echo'ref:refs/heads/master'>。git/HEAD应该这样做