Confession time, because my mistakes are the only lessons I reliably learn from.
Last month I rebased my feature branch and needed to push it. Git refused, as it should. So I did what everyone does:
git push --force
What I did not know: a colleague had pushed a commit to the same branch an hour earlier. My force push replaced the remote branch with my version and his commit disappeared from the branch. It was still in his local clone, thankfully, and in my reflog because I had fetched it, but we lost an afternoon working out what happened.
The command I should have used:
git push --force-with-lease
It means "overwrite the remote only if it is still at the commit I last saw". If someone pushed in the meantime, the push fails and I have to look at their work first. Costs nothing. Now I have it as the only force I allow myself: a shell alias, and no plain --force anywhere.
Lesson: the reflog is a seatbelt, not a safety plan.