The safest and probably cleanest way to go is to rebase interactively.
git rebase -i HEAD^^
git rebase -i baf8d5e7da9e41fcd37d63ae9483ee0b10bfac8e^
From there you can squash commits, which puts one or more commits together into the previous commit. To completely delete a commit from the history, delete the line from the list.
You can revert a commit with
git revert but its going to add more commit messages to the history, which may be undesirable. Use the
-n parameter to tell Git not to commit the revert right away. You can rebase interactively and squash those on up to a previous commmit to keep things clean.
If the two commits you're working with here affect the same file(s), you may see a merge conflict.
Resetting the repository with
git reset --hard should be done with care, as it cannot be undone.
Rewriting history should be done with care.