Cause 1 of 5
Both sides edited the same lines.
git status lists the conflicted files. In each one, find the <<<<<<< HEAD, ======= and >>>>>>> markers and edit that region into the code you actually want — often a combination rather than one side wholesale. Delete all three marker lines, git add the file, then git commit (or git rebase --continue).
Cause 2 of 5
One side deleted a file the other side edited.
Git reports it as 'deleted by us' or 'deleted by them' and leaves the surviving version in the working tree either way — the conflict message names which one. To keep the file, git add <file>; to accept the deletion, git rm <file>. Do not reach for git checkout --ours/--theirs here: only one side has a version of this file, so the other name fails with 'path does not have their version'.
Cause 3 of 5
A generated file such as a lockfile conflicts.
Do not hand-merge a lockfile. Take either side and regenerate it: git checkout --theirs package-lock.json then npm install, and commit the result. A hand-edited lockfile produces an install nobody else can reproduce.
Cause 4 of 5
The merge is more tangled than expected and you want out.
git merge --abort — or git rebase --abort during a rebase — restores the exact state you started from. It is safe and specifically designed for this, so use it rather than pushing through a merge you do not understand.
Cause 5 of 5
You cannot tell what each side intended.
git log --merge -p <file> shows only the commits from both sides that touched the conflicted file. git checkout --conflict=diff3 <file> rewrites the markers to include the common ancestor as well, which usually makes the intent of each change obvious.