正在中止 `git stash apply`
我很遗憾应用了存储(错误的分支)。我如何撤消此操作并将我的存储返回到我的存储列表,以便稍后将其应用到正确的分支?
I regret having applied a stash (wrong branch). How can I undo this and have my stash back to my stash list in order to apply it later on the right branch?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您还没有提交,您应该能够再次
git stash
,可能首先使用git reset HEAD
。此外,
git stash apply
不会像git stash pop
那样删除存储。因此,如果您已提交,则可以git reset --hard [last_good_commit]
(如果您尚未推送)或git revert [last_good_commit]
(如果您已推送)当你到达正确的分支时,只需再次应用隐藏的东西即可。注意:运行
git reset --hard
将删除任何未提交的代码。If you haven't committed, you should just be able to
git stash
again, possibly with agit reset HEAD
first.Also,
git stash apply
doesn't delete the stash likegit stash pop
does. So if you have committed, you couldgit reset --hard [last_good_commit]
(if you haven't pushed) orgit revert [last_good_commit]
(if you have pushed) and just apply the stash again once you're on the right branch.Note: Running
git reset --hard
will delete any uncommitted code.