First rebase to the commit right before the one you want to change. Make the change. Commit. Rebase back.
http://stackoverflow.com/questions/1186535/how-to-modify-a-specified-commitÂ
You can use git rebase, for example, if you want to modify back to commit bbc643cd, run
$ git rebase --interactive bbc643cd^
In the default editor, modify ‘pick’ to ‘edit’ in the line whose commit you want to modify. Make your changes and then commit them with the same message you had before:
$ git commit -a --amend --no-edit
to modify the commit, and after that
$ git rebase --continue
to return back to the previous head commit.