Interactive rebasing is a good way to modify individual commits.
git filter-branch is a good way to edit commits en masse.