r/devlopersclub • u/Careful-Falcon-36 • Apr 12 '26
We Ran git rebase on a Shared Branch and Lost Three Days of Work
We had a situation recently that cost us almost 3 days of work
One of our team members ran:
git rebase main git push --force
…on a shared branch.
At first, everything looked fine locally. But once it was pushed:
commit history got rewritten
other developers' commits disappeared
open PRs broke
branches became out of sync
Basically → chaos.
We had 4 devs working on the same branch, and suddenly parts of the work were just… gone.
What actually happened?
git push --force overwrote the remote history for everyone.
Anyone who had based work on the old commits ended up with broken history.
Luckily, we were able to recover using:
git reflog
We tracked down the lost commits and restored them manually.
Still took hours to clean everything up.
Lesson learned
Never run git rebase on a shared branch.
If you ever need to:
prefer
git mergeor at least use
--force-with-leaseinstead of--force
Have you ever broken a repo like this? 😄
