I've made some changes in my master branch that I no longer see fit. For arguments sake, I have a commit hash named 791fda4e1ac0e1a393e01340bf0fba3f333a73ff
that I'd like to make my HEAD now, as that's when everything was stable in the repo. I've tried to do the following:
git reset 791fda4e1ac
git reset --soft HEAD@{1}
git commit -m "Revert to 791fda4e1ac"
git reset --hard
Yet, when I do a git push origin
, I get rejected, because origin thinks it's a non-fastforward push:
! [rejected] master -> master (non-fast-forward)
What's the right way of reverting my HEAD back to commit hash 791fda4e1ac and getting the origin server there as well?