Can I recover a branch after its deletion in Git?

后端 未结 20 2435
广开言路
广开言路 2020-11-22 05:53

If I run git branch -d XYZ, is there a way to recover the branch? Is there a way to go back as if I didn\'t run the delete branch command?

20条回答
  •  我寻月下人不归
    2020-11-22 06:38

    First go to git batch the move to your project like :

    cd android studio project
    cd Myproject
    then type :
    git reflog
    

    You all have a list of the changes and the reference number take the ref number then checkout
    from android studio or from the git betcha. another solution take the ref number and go to android studio click on git branches down then click on checkout tag or revision past the reference number then lol you have the branches.

提交回复
热议问题