![](/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.