How to recover a dropped stash in Git?

前端 未结 19 1733
别跟我提以往
别跟我提以往 2020-11-22 01:42

I frequently use git stash and git stash pop to save and restore changes in my working tree. Yesterday I had some changes in my working tree that I

19条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-22 01:56

    Just wanted to mention this addition to the accepted solution. It wasn't immediately obvious to me the first time I tried this method (maybe it should have been), but to apply the stash from the hash value, just use "git stash apply ":

    $ git stash apply ad38abbf76e26c803b27a6079348192d32f52219
    

    When I was new to git, this wasn't clear to me, and I was trying different combinations of "git show", "git apply", "patch", etc.

提交回复
热议问题