I have a remote Git repository, and I need to roll back the last n commits into cold oblivion.
Fortunately I was in a position to use Pat Notz's solution which completely removed the unwanted commit. However, initially I got the error
error: failed to push some refs to 'ssh://git@gitrepo.git'
To prevent you from losing history, non-fast-forward updates were rejected*
But adding the force (-f) option overwrite this error
git push -f origin 52e36b294e:master