检索已删除的,不是类似于存储的提交的存储 [英] Retrieve a deleted stash that is not a stash-like commit

查看:46
本文介绍了检索已删除的,不是类似于存储的提交的存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照说明此处为了恢复我误删的存储,但是当我尝试应用它时,出现错误消息:

I followed the directions here in order to recover a stash I deleted by mistake, but when I try to apply it, I get an error message:

boonie@elementary:~/akanbar-system$ git fsck --unreachable
Checking object directories: 100% (256/256), done.
Checking objects: 100% (702/702), done.
unreachable commit 0f34656bf920ac827702190de57459f77e8310ec
unreachable blob 3af4303a950ade7cca4c8c20b10404bc95b30605
unreachable commit f7142808a8b972f7ec259ca4a3c71c10a9549396
boonie@elementary:~/akanbar-system$ git stash apply 0f34656bf920ac827702190de57459f77e8310ec
'0f34656bf920ac827702190de57459f77e8310ec' is not a stash-like commit

我尝试寻找解决方案,但找不到任何解决方案.请帮忙!

I've tried searching for a solution but I can't find any. Please help!

解决方案:伙计们,我不确定这到底是如何工作的,但是我应用了第二个无法到达的提交而不是第一个(我想要的)提交,它恢复了所有内容.他们一定已经以某种方式连接了起来.希望这对将来的人有所帮助,如果没有,那么使用下面另一种方法回答的人也将有所帮助!

Solution: Guys, I'm not sure how exactly this worked, but I applied the second unreachable commit instead of the first one (which was the one I wanted) and it restored everything back. They must have been connected somehow. Hopefully this helps someone in the future, and if not, someone who answers with another method below will also help!

推荐答案

恢复丢失的藏匿点

  1. gitk --all $(git fsck --no-reflog | awk'/dangling commit/{print $ 3}')

您可以通过重置或签到另一个分支来获取它.

you can get it by reset or checkout to another branch.

用于重置: git reset-硬< hashCode>

结帐: git branch< desire_branch_name>< hashCode>

这篇关于检索已删除的,不是类似于存储的提交的存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆