撤消意外的混帐隐藏流行 [英] Undoing accidental git stash pop

查看:84
本文介绍了撤消意外的混帐隐藏流行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在进行复杂的合并之前,我进行了一些本地更改,进行了合并,然后在运行 git stash pop 之前愚蠢地忘记了提交。流行造成了一些问题(在一个大的代码库中糟糕的方法调用),这些问题很难追查到。我运行了 git stash show ,所以我至少知道哪些文件发生了变化。如果没有别的,我想这是一个提供更多的教训。



我的问题:是否可以撤消隐藏弹出窗口而不撤销合并? in-git>如何在Git中恢复被丢弃的藏匿处?以找到您弹出的藏匿处。我认为总是存在两个提交,因为它保留了索引和工作副本(索引提交常常是空的)。然后 git show 它们来查看diff,并使用 patch -R 来取消应用它们。


I stashed some local changes before doing a complicated merge, did the merge, then stupidly forgot to commit before running git stash pop. The pop created some problems (bad method calls in a big codebase) that are proving hard to track down. I ran git stash show, so I at least know which files were changed. If nothing else, I guess this is a lesson to commit more.

My question: is it possible to undo the stash pop without also undoing the merge?

解决方案

Try using How to recover a dropped stash in Git? to find the stash you popped. I think there are always two commits for a stash, since it preserves the index and the working copy (so often the index commit will be empty). Then git show them to see the diff and use patch -R to unapply them.

这篇关于撤消意外的混帐隐藏流行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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