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

问题描述 投票:1回答:1

我正在合并中,我只是做了git checkout --theirs my_file而我想要git checkout --ours my_file

有办法扭转它吗?

git
1个回答
2
投票

TL; DR:只是git checkout --ours my_file


正如@matt在评论中提出的那样,您可以使用git checkout <version> -- my_file签出所需的特定版本。

最简单的方法是实际输入第二个命令git checkout --ours my_file,因为--ours--theirs是对基本分支和合并分支的引用。所以它基本上就像@ matt的解决方案,更简单的参考。

© www.soinside.com 2019 - 2024. All rights reserved.