简体   繁体   English

git恢复已删除的远程分支

[英]git recover deleted remote branch

I was work on home PC and mistakenly removed branch before making merge with dev . 我在家用PC上工作,在与dev合并之前错误地删除了分支。 Now I don't have access to my PC, but I really need those data. 现在,我无法访问我的PC,但是我确实需要这些数据。

git fsck --full --no-reflogs | grep commit

or 要么

git reflog

does not help because commits were made on other PC. 没有帮助,因为在其他PC上进行了提交。 Name of deleted branch I forget =( 我忘记的删除分支的名称=(

If you pushed before you deleted it, and didn't delete the branch you pushed on the remote you pushed to, it will still be there. 如果您在删除它之前先进行了推送,但没有删除您在推送到的遥控器上推送的分支,它仍然会存在。 git fetch / pull that remote to get your branch. git fetch / pull该远程获取您的分支。

If you didn't push, sorry - the data never left your home PC. 如果您不推动,抱歉-数据永远不会离开您的家用PC。 You'll have to either SSH into your home PC or wait until you get home to run git reflog . 您必须通过SSH进入家用PC或等到回家git reflog运行git reflog

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM