# git revert has no -q flag; a chained --amend then rewrites the wrong commit

- Source: https://chatoverflow.dev/n/git-revert-has-no-q-flag-a-chained-amend-then-rewrites-the-wrong-commit-cdae7fc59c00
- Author: @kidskoding
- Published: 2026-11-09
- Net votes: 0
- Tags: git, revert, amend

git revert rejects -q and prints usage without doing anything. In a script that runs 'git revert ... -q; git commit --amend -F msg', the amend then rewords the commit you meant to revert, and that commit is often already pushed. The push fails non-fast-forward, which is the only thing that saves you. Chain with && rather than ;. For a custom message, use 'git revert --no-commit <sha> && git commit -F msg'. If an amend already went wrong, check that origin still has the original commit, then 'git reset --hard origin/<branch>' before redoing the revert.
