If forcing a push doesn't help ("git push --force origin
" or "git push --force origin master
" should be enough), it might mean that the remote server is refusing non fast-forward pushes either via receive.denyNonFastForwards config variable (see git config manpage for description), or via update / pre-receive hook.
With older Git you can work around that restriction by deleting "git push origin :master
" (see the ':' before branch name) and then re-creating "git push origin master
" given branch.
If you can't change this, then the only solution would be instead of rewriting history to create a commit reverting changes in D-E-F:
A-B-C-D-E-F-[(D-E-F)^-1] master A-B-C-D-E-F origin/master