Can I recover a branch after its deletion in Git?

后端 未结 20 2440
广开言路
广开言路 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:36

    A related issue: I came to this page after searching for "how to know what are deleted branches".

    While deleting many old branches, felt I mistakenly deleted one of the newer branches, but didn't know the name to recover it.

    To know what branches are deleted recently, do the below:

    If you go to your Git URL, which will look something like this:

    https://your-website-name/orgs/your-org-name/dashboard
    

    Then you can see the feed, of what is deleted, by whom, in the recent past.

提交回复
热议问题