These days git filter-branch shows a warning, recommending git filter-repo which can solve some complex scenarios.
Also git revise is an efficient alternative to git rebase for changing only history, but not files.
# Squash some fixup commits without checking out old commits.
git revise -i --autosquash @{u}
# Edit all commit messages since upstream in a single buffer.
git revise -ie @{u}
# Switch the order of the last two commits
GIT_SEQUENCE_EDITOR='kak -f gkxdp' git revise -i HEAD~2
(Actually the 0.6.0 release is mistakenly using SEQUENCE_EDITOR, but that is to be fixed in the next release).