I’ve had juniors who didn’t believe this, so just to say it: If you know what you’re doing, practically any Git problem is recoverable.

The one major exception is if you delete your local changes before committing them.

Yeah.But many of them are extremely annoying. Specifically screwing up rebase. It is recoverable, but very annoying.

That said I have seen juniors make two other common mistakes.

  • Pushing your commit without fetching
  • Continuing on a branch even after it was merged.
  • I’m fed up with these two. Yesterday I had to cherry-pick to solve a combination of these two.

    I’ll get chastised, but when I screw up a rebase I create a backup branch and then have an LLM do the fixing…

    I’m not proud of it, but I’m a lazy man who doesn’t want to resolve the same conflict 32 times.

    Having to resolve the same conflict multiple times suggests excess noise in your git history. You might want to pay closer attention to creating a useful git history. It’ll help with any future archaeology, and it’ll also help rebasing go smoothly.