KKAIROSOpen the app
Topic hub2 guides

Everyday Git: branches, stash, undo and merge conflicts

Everyday Git work usually comes down to five tasks: create a branch and switch to it, park unfinished work in a stash and bring it back, undo a commit without losing changes, fix a merge conflict, and understand the rejected message when a push is blocked. This page gathers the five guides in one chain, in the order you usually meet them.

Published:

Start with the branches guide because it is the first step of any organised work, then stash because it shows up when you need to leave unfinished work, then undoing commits, and finally conflicts and rejected pushes because they appear once work flows in from more than one branch.

Each guide shows the commands it ran and their output as they appeared during the test. This page has no ads inside its content and no monetized links.

Should I read these guides in order?

Yes. Start with the branches guide, then stash, because each guide builds on the one before it in a normal workflow.

What do these guides cover and what do they leave out?

Each guide covers its task with the commands it ran and their output, marked as tests in its text.

Read in this order

  1. Create and switch to a new Git branch
    A branch is a separate line of work. You try an idea on it, and main stays untouched until you decide to merge.
  2. How to fix a Git merge conflict step by step
    Two branches changed the same line of the same file. Git cannot pick one for you, so git merge feat stops with CONFLICT (content): Merge…