Aborting a stash pop in Git

后端 未结 14 2225
鱼传尺愫
鱼传尺愫 2020-12-22 17:47

I popped a stash and there was a merge conflict. Unlike the question that is listed as a duplicate, I already had some uncommitted changes in the directory which I wanted to

14条回答
  •  眼角桃花
    2020-12-22 18:04

    My use case: just tried popping onto the wrong branch and got conflicts. All I need is to undo the pop but keep it in the stash list so I can pop it out on the correct branch. I did this:

    git reset HEAD --hard
    git checkout my_correct_branch
    git stash pop
    

    Easy.

提交回复
热议问题