I did a commit and reverted with
git revert HEAD^
just git log
➜ git:(master) git log
commit 45a0b1371e4705c4f875141232d7
If you don't care about the commit, just do:
git reset --hard HEAD~
to blow away the commit.
If you want the changes to be in working directory, do:
git reset HEAD~
Depending on what you have done with git revert, you might have to change the above commands. Revert creates a new commit that reverts the commit you wanted to revert. So there will be two commits. You might have to do HEAD~2 to remove them both.
Note that, usually, revert is the safer way to, well, revert changes. But here, since you want to remove sensitive data, reset is the best approach.