lost git stash changes

后端 未结 3 498
误落风尘
误落风尘 2020-12-13 09:47

So here\'s what happened: I was on a branch \'A\' and did a Git stash on that branch. Then I switched to another branch \'B\'. I navigated back to Branch \'A\' but did not d

3条回答
  •  再見小時候
    2020-12-13 09:57

    We also faced the same issue. So, here is how we recovered the lost changes:

    1. Go back to branch B.

      git checkout B

    2. Use git reflog option to mange reflog information.

      git reflog --all

      Output:

      f332d5c refs/stash@{0}: WIP on B: aa1d0c1 xyz commit message

    3. Now, switch to branch A using git checkout A

    4. Finally, to recover your lost changes.

      git stash apply f332d5c

提交回复
热议问题