How these pages work
Git problems have a small number of causes. Each page here takes one situation, shows the commands, and shows what Git printed when we ran them. You can compare your screen with ours.
Before you start
- Run
git status. It tells you which branch you are on and what is changed. - If the work matters, make a copy of the branch first:
git branch backup. - Do not rewrite commits that others already have.
Do I need to know Git well?
No. Each page is written for a person who has made one specific mistake.
Will these commands work with GitHub?
Yes for the local steps. Pushing and pulling are not covered here.
This is an independent guide. It is not connected with the Git project, GitHub, GitLab or any company named here. Every command below was run on 14 November 2026 with the real program (git version 2.56.0.windows.4) in a new empty practice repository; the output shown is what it printed. Facts about options were read in the official Git documentation on 14 November 2026.