You need to do
with correct parameters. To rewrite your history.
and then you've to push this with --force to your remote repository.
Note that this will make things a bit harder for everyone that uses that
repository since they will have to do a rebase or a fresh clone.
git push --force
To remove the commit from your branch. Now the commit will still be
present for another 14 days or so on your remote and on the computer that
contained that commit. Either you don't care or you run
git gc --prune=now