There are two approaches here.
The first is to reset
your local branch, as if these changes never existed, and then force update the remote branch:
git rest <hash>
git push https://git.... --force
The main problem with this approach is the difficulty it creates for anyone else working with your remote.
The more "elegant" solution, IMHO, is to revert the change - i.e., acknowledge a mistake has been made, and rectify it, preserving history.
You can use git revert <hash>
to create an additional commit that undoes the problematic commit, and then just git push
it like every other commit.
The advantage is that you can always amend the commit message, and explain exactly why the original solution was faulty, and why it had to be undone.