git藏匿处 - 本地变化 - git储藏 - git储藏应用 - 撤消
需要一些帮助,我搞砸了。请保留判断。
好吧,这就是我所做的。
git stash
对代码进行了一些更改。
git储藏(再次)
git储藏应用
是否有任何方法可以回到第一个Git藏匿之前的代码。
任何帮助将不胜感激。
提前致谢。
Need some help, I screwed up. Please reserve judgement.
Alright, this is what I did.
git stash
made some changes to the code.
git stash (again)
git stash apply
Is there any way I can get back to the code I had before the first git stash.
Any help would be appreciated.
Thanks, in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
欣赏应用或弹出git储藏只会改变工作目录和/或阶段。它不会做出新的提交。因此,简单地进行硬重置应该让您回到第一个藏匿之前的位置:
话:如果您想保留自第一个藏匿以来的变化列入,那是另一个故事并且需要更多的工作和思考才能实现。
注意:一般而言,弹出git藏匿处是有风险的,因为如果一路走了问题,就无法重新涂上与已经从堆栈中弹出的藏匿处。使用
git存放应用
以获得最佳结果。Appreciate that applying or popping a Git stash just alters the working directory and/or stage. It does not make a new commit. Therefore, simply doing a hard reset should get you back to where you were before the first stash:
That being said, if you wanted to retain some permutation of the changes since the first stash, that is another story and would require more work and thought to pull off.
Note: Generally speaking, popping a Git stash is risky, because if something goes wrong along the way, you can't reapply the same stash as it has already been popped from the stack. Use
git stash apply
for best results.