我在 visual studio 2013 中使用 git 工作,今天我意外地删除了一个分支。现在,当我去创建分支时,它不会显示在下 pull 列表中以再次选择和创建它。
最佳答案
第 1 步:
创建所有无法访问的提交的列表。
git fsck --full --no-reflogs --unreachable --lost-found
第 2 步:
打印失物招领处所有提交的提交消息列表。
ls -1 .git/lost-found/commit/ | xargs -n 1 git log -n 1 --pretty=oneline
第 3 步:
搜索您丢失的提交。创建一个新分支,将缺少的提交作为分支头。
git checkout -b branch-name SHA
关于git - 在 visual studio 中意外删除分支 git,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30035998/