![](/img/trans.png)
[英]Can someone tell me how I can get the master branch on my local repo to reflect the master branch on the remote repo?
[英]I Accidentally Pulled Master branch Of Repo1 Into local and changed Remote to Repo2 and pushed to specific Branch. How to Revert This?
我不得不 -
我做了-
我不在乎我的代码是否丢失,我只想在没有任何分支冲突的情况下重新执行此过程
执行这些步骤
git 日志 // 然后复制提交 id,您的分支的 state 是
correct
的。git 重置 --hard commitId
git 推-f
如果您不想丢失代码:
git 日志 // 然后复制提交 id,您的分支的 state 是
correct
的。git 重置 --soft commitId
git 复位。
- git stash //保存工作
- git reset --hard //擦除所有内容
- git 推-f
现在克隆正确的存储库并应用: git stash pop
//这将在预期的存储库中引入更改
解决是否存在任何合并冲突。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.