Discard Git Stash Pop

前端 未结 3 1701
星月不相逢
星月不相逢 2021-01-31 00:49

I did a git stash pop and now I have a ton of conflicts. I had committed all my recent code before the git stash pop, so is there a way to go back to the last commi

3条回答
  •  失恋的感觉
    2021-01-31 01:16

    If you never want to see the work in the popped stash again, this is as simple as a hard reset:

    git reset --hard HEAD
    

    This tells git to ignore the fact that you have uncommitted changes in your working directory, and sets the working directory, the staging area, and head to the commit you specify -- in this case, the existing HEAD, that contains all the work you've just committed.

提交回复
热议问题