git - 意外删除远程分支

标签 git github

我有一个远程分支,我刚刚 checkout 。我想删除其他一些分支,但不小心删除了“开发”分支。

git push origin :Development

现在我试图通过这个命令取回它

git push origin head

这个和

一样吗
(git push origin Development :Development)

这会有什么影响吗?我需要做的任何其他事情,以保持这个分支与以前相同。

我看到的一个影响:-

All pull requests were declined which were not approved before deletion.

我们是否必须再次发送 pull 请求。

最佳答案

Will this have any impact ?

如果您的本地开发分支是最新的,则不会有任何影响。
远程 repo 将恢复该分支,其历史记录完好无损。

新的远程分支从删除的分支推迟的唯一方法是您在本地更改其历史记录(就像使用 rebase )

关于git - 意外删除远程分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36418386/

相关文章:

eclipse - 开始将 Eclipse GIT 与现有项目一起使用...项目文件已移动

android - Git stash apply 在文件中留下额外的字符串

git - 让 Git GUI 忽略差异 View 中的空间变化

git - 如果你不能提交到他们的分支,你怎么能将提交到另一个人的 github pull request 添加到你的 repo?

Git merge 分支到master

git - 关于 SVN <-> Git 工作流的建议

git - 在 gitflow 工作流中处理 pull 请求的工作流(不经常发布)?

github - 如何从 github graphql 查询获取拉取请求的默认合并方法?

Azure DevOps - Github 状态检查

git - pull 和推到github时出错