Be careful with that.
But you can use the rebase command
git rebase -i HEAD~2
A vi
will open and all you have to do is delete the line with the commit. Also can read instructions that were shown in proper edition @ vi
. A couple of things can be performed on this mode.