Last modified: March 23, 2026

This article is written in: πŸ‡ΊπŸ‡Έ

Common Git Confusions

Git is a powerful tool, but its complexity often puzzles newcomers. Let’s break down some typical areas where users get tripped up in simpler terms:

Git-specific Terminology

Branching and Merging

<<<<<<< HEAD
Your version of this line
=======
Their version of this line
>>>>>>> feature-branch

To resolve: edit the file to keep the right version (or combine both), remove the markers, then git add the file and commit.

Using the Command-Line Interface

A good learning approach: start with CLI basics to understand what Git does, then adopt a GUI for visualization (commit graphs, complex diffs). When the GUI does something unexpected, check git log or git status in the terminal to see what actually happened.

Undoing Changes

Here is a quick comparison of the three main undo strategies:

Strategy History Safety Best For
git revert Preserved (adds new commit) Safe for shared branches Undoing published changes
git reset Rewritten (moves branch pointer) Dangerous on shared branches Undoing local mistakes
git checkout/restore Unchanged Safe Discarding working directory changes

git revert:  A──B──C──D──D'   (D' undoes D; history preserved)

git reset:   A──B──C           (D removed from history)

git restore: Working directory changes discarded, commits untouched

Dangerous Commands

Detached HEAD State