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

[亡魂溺海] 提交于 2019-11-29 02:32:29

问题


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.

How would I got about achieving this on the remote one?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/15596670/recovering-a-deleted-branch-from-a-remote-on-bitbucket-git

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!