在进行复杂的合并之前,我隐藏了一些本地更改,进行了合并,然后在运行之前愚蠢忘了提交git stash pop
.流行音乐创建了一些问题(在大代码库中调用错误的方法),这些问题很难被追踪.我跑了git stash show
,所以我至少知道哪些文件被更改了.如果没有别的,我想这是一个承诺更多的教训.
我的问题:是否有可能撤消存储流行而不撤消合并?
Ben*_*son 67
尝试使用如何在Git中恢复被删除的存储?找到你弹出的藏匿处.我认为存储总是有两个提交,因为它保留了索引和工作副本(所以索引提交通常都是空的).然后git show
他们看到差异并使用patch -R
取消应用它们.
kac*_*har 35
从 git stash --help
Recovering stashes that were cleared/dropped erroneously
If you mistakenly drop or clear stashes, they cannot be recovered through the normal safety mechanisms. However, you can try the
following incantation to get a list of stashes that are still in your repository, but not reachable any more:
git fsck --unreachable |
grep commit | cut -d\ -f3 |
xargs git log --merges --no-walk --grep=WIP
Run Code Online (Sandbox Code Playgroud)
这对我来说比同样情景下的接受答案更好.
归档时间: |
|
查看次数: |
93967 次 |
最近记录: |