You accidentally committed `.env` with the production AWS keys and pushed. Rotating the key is step zero — but you also need it gone from history.
Rewriting history with filter-repo (or BFG) is required. Force-push to fix remote.
Expert · 4 steps · +900 XP
This scenario walks through 4 steps, in order:
Try the terminal first — you learn more by doing. When you want to check yourself, here is the command for each step.
git ls-filesgit filter-repo --path .env --invert-pathsgit push --force-with-lease origin maingit gc --prune=now --aggressiveRotate first, rewrite second. Anything pushed to a public remote should be considered compromised forever.