【问题标题】:Retreive commits that got detached from the main tree without tags or branches present检索与主树分离且不存在标签或分支的提交 【发布时间】:2018-03-15 09:38:37 【问题描述】: 我的提交与主树分离,没有标签或分支。 有没有办法找回它们? 【问题讨论】: 标签: git add restore 【解决方案1】: 我最终首先运行 bash-command:'find 。 * | less' 来自项目根目录中的 .git 文件夹。 然后我在第一个命令中发现了一个名称类似于“lost&found”的文件夹。 我进入它并收到了这些提交的所有 id。 签出它们,然后检索丢失的数据。 【讨论】: