Merge Conflict
Happens when Git cannot automatically combine overlapping edits from two branches.
Advanced Collaboration And Recovery
Learn how experienced teams handle merge conflicts, rebase safely, and recover from production mistakes without losing auditability.
How to use this page: read each workflow, then run the commands in the interactive console and verify the graph changes.
Happens when Git cannot automatically combine overlapping edits from two branches.
Files show <<<<<<<, =======, and >>>>>>> blocks to resolve manually.
Occurs while replaying commits onto a new base. Resolve each commit, then continue rebase.
Applies one specific commit to another branch, useful for urgent hotfix back-ports.
revert adds a safe undo commit for shared history. reset rewrites local branch history.
Use --force-with-lease only on agreed branches and never on protected production branches.
| Situation | Recommended command | Reason |
|---|---|---|
| Bad commit already shared | git revert <sha> |
Preserves audit trail and avoids rewriting teammates' history. |
| Local commit not pushed yet | git reset --soft HEAD~1 |
Allows editing commit before sharing while keeping file changes staged. |
| Hotfix must also reach release branch | git cherry-pick <sha> |
Moves one proven fix without merging unrelated commits. |
| Emergency production rollback | git revert <sha> + redeploy pipeline |
Fast, traceable rollback that fits regulated release controls. |