← Change mode
Red teamThree days of a colleague's work vanished from main
Githard
A colleague reports that their commits from the last three days are gone from `main`. `git log` on `main` shows your commits but not theirs. They have not deleted anything and their local branch still has their work.
You rebased your feature branch onto `main` yesterday to tidy the history, then pushed. The push was rejected as non-fast-forward, so you used `git push --force` and it succeeded.
Explain the exact mechanism by which their commits left main, whether the work is recoverable and how, and what single flag would have prevented this while still letting you push your rewritten branch.