I pushed a commit to the remote repository and I want to undo that commit.
To undo the commit in my local repository I used
git reset --hard prev_commit_hash
(By the way, is this the proper way to do that?)
Then I tried to push, and failed, because the tip of my current branch is behind its remote counterpart, as I expected.
The question is: What is the proper way to perform a hard/forced push?
I viewed some of the other similar questions asked, but they were a little old.
The suggested solution was using
. And I saw that recently users commented that this solution is not working for them.