You can use Git rebasing. For example, if you want to modify back to commit bbc643cd, run
$ git rebase bbc643cd^ --interactive
In the default editor, modify 'pick' to 'edit' in the line whose commit you want to modify. Make your changes and then stage them with
$ git add
Now you can use
$ git commit --amend
to modify the commit, and after that
$ git rebase --continue
to return back to the previous head commit.