Aborting `git stash apply` [duplicate]

狂风中的少年 提交于 2019-12-03 14:23:14

问题


Possible Duplicate:
How to reverse apply a stash?

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?


回答1:


If you haven't committed, you should just be able to git stash again, possibly with a git reset HEAD first.

Also, git stash apply doesn't delete the stash like git stash pop does. So if you have committed, you could git reset --hard [last_good_commit] (if you haven't pushed) or git revert [last_good_commit] (if you have pushed) and just apply the stash again once you're on the right branch.



来源:https://stackoverflow.com/questions/9242844/aborting-git-stash-apply

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!