简体   繁体   English

如何恢复解决冲突的解决方案?

[英]how to I revert my solutions to resolve the conflicts?

I have made a few changes, then pulled from git. 我做了一些更改,然后从git中撤出。

I have had merge conflicts after pulling from git. 从git拉出后,我发生了合并冲突。

I have resolved these conflicts, but my app doesn't work as expected. 我已经解决了这些冲突,但是我的应用无法正常工作。

How can I revert my solutions (undo) conflict resolution? 如何恢复解决方案(撤消)冲突解决方案?

I'm using 'egit', and 'source tree' 我正在使用“ egit”和“ source tree”

btw, what is a recommended conflict resolver tool? 顺便说一句,什么是推荐的冲突解决工具?

git reset --hard HEAD~1 will put your code and git repo both back to where they were before the last commit, which is probably the merge commit. git reset --hard HEAD~1会将您的代码和git repo都放回到上一次提交之前的位置,这可能是合并提交。 Then you can try merging again. 然后,您可以尝试再次合并。

If you don't care about the changes you had, you can always nuke everything local and start with a fresh git clone . 如果您不关心所做的更改,则始终可以在本地查看所有内容,并从新的git clone

您可以使用git merge --abort中止整个合并过程,并将存储库恢复为合并前的状态。

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

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