Git undo local branch delete

后端 未结 8 1770
慢半拍i
慢半拍i 2020-11-29 14:52

I just deleted the wrong branch with some experimental changes I need with git branch -D branchName.

How do I recover the branch?

8条回答
  •  死守一世寂寞
    2020-11-29 15:15

    If you know the last SHA1 of the branch, you can try

    git branch branchName 
    

    You can find the SHA1 using git reflog, described in the solution here.

提交回复
热议问题