
RR Job Portal
Overview
This case study covers an unexpected Git history rewrite on main across multiple repositories connected to one GitHub account and two organizations. The goal was to confirm whether the force pushes came from this Laravel project’s automation, recover only the affected main branches without wiping later valid work, and put controls in place so the same rewrite cannot happen again. Investigation showed the project itself did not auto-push. The likely trigger was rewriting an already-published commit, then updating remote main with a force push.
The challenge
The same GitHub account had write access across two organizations, so the force push was not limited to one repo. GitHub Activity showed main rewritten from an older commit to a new commit with the same message, which is typical after git commit --amend followed by a force or force-with-lease push. There was no safe one-click revert for every repo, because each main branch had a different old hash, new hash, and later commits. Blind bulk reset risked deleting valid work. The recovery had to be limited to main, restore from the pre-force-push commit where known, and freeze access first so the branches could not be overwritten again.
Gallery
2 items