Git stash: “Cannot apply to a dirty working tree, please stage your changes”

后端 未结 11 1659
青春惊慌失措
青春惊慌失措 2020-12-12 09:04

I am trying to apply changes I stashed earlier with git stash pop and get the message:

Cannot apply to a dirty working tree, please stage your c         


        
11条回答
  •  不思量自难忘°
    2020-12-12 09:30

    None of these answers actually work if you find yourself in this situation as I did today. Regardless of how many git reset --hard's I did, it got me nowhere. My answer (not official by any means was):

    1. Figure out the stash's hash use git reflog --all
    2. Merge that hash with the branch you're interested in

提交回复
热议问题