How Git undoes a merger
This article mainly shows you "how Git cancels a merger". The content is simple and easy to understand and the organization is clear. I hope it can help you solve your doubts. Let Xiaobian lead you to study and learn this article "how Git cancels a merger".
Undo a merger
If it is a local branch, just git reset --hard.
If the branch has been pushed to the far end, say merged into master, it is sent to the line only to find a bug that needs to be rolled back. At this point, the branch may already be used by others. According to "Do not modify remote branches shared by many people", you need to execute git revert -m 1 and add a revert node, such as E'in the following figure.
However, be careful not to continue development in the original feature branch, but to delete the original branch, pull a new branch from the E'node to do bug fixes, etc.
If you continue to develop on the original feature branch, you need to do a reverse operation to reverse the E'node when merging back to master, and change it to E'(as shown in the figure below), otherwise it is easy to lose files and other problems. Refer to the summary in Branch Merger for specific cause analysis.
That's all for the article "How Git Undoes a Merge." Thanks for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!