簡體   English   中英

是否可以撤消`git checkout --theirs / ours`?

[英]Is it possible to undo `git checkout --theirs/ours`?

我正處於合並的中間,我只是進行了git checkout --theirs my_file而我想進行git checkout --ours my_file

有辦法扭轉它嗎?

TL; DR :僅git checkout --ours my_file


正如@matt在評論中建議的那樣,您可以使用git checkout <version> -- my_file -my_file簽出所需的特定版本。

實際上,最簡單的方法是鍵入第二個命令git checkout --ours my_file因為--ours--theirs是對基礎分支和合並分支的引用。 因此,基本上就像@matt的解決方案一樣,帶有更簡單的參考。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM