Recovering a deleted branch from a remote on Bitbucket (git)

后端 未结 2 1520
無奈伤痛
無奈伤痛 2020-12-29 09:28

I want to recover a branch that was deleted from our remote shared repository on Bitbucket. I know that reflog is the way to go with local repositories.

相关标签:
2条回答
  • 2020-12-29 09:37

    Four years later...

    I came across this answer because I deleted a branch through the bitbucket.org UI that a team member wanted restored.

    I discovered that git branch --remote shows all the branches on origin, even the ones that are deleted through the UI.

    I checked out the origin branch locally with git checkout origin/<branch_name> -b <branch_name>, then did git push -u origin <branch_name> and it showed up in the UI again.

    0 讨论(0)
  • 2020-12-29 09:44

    reflog is still the answer, except you don't have access to the reflog on the remote (Bitbucket ) side.

    That means you need to write to Bitbucket support in order for them to restore what you need.

    0 讨论(0)
提交回复
热议问题