I can't find working solution for my problem:
How to remove commit in local and also in remote repository.
Here is one solution. But when I try this I can go back with reset
command in my local repository. But I can't push it. The error message says:
remote: error: denying non-fast-forward refs/heads/master (you should pull first)
But after pull
my master points again to the commit that I want to remove.
Can you help?
EDIT - my try:
$ git reset --hard HEAD^1
HEAD is now at 1c50f9c good commit
$ git push -f
Total 0 (delta 0), reused 0 (delta 0)
remote: error: denying non-fast-forward refs/heads/master (you should pull first)
To E:/reps/gf.git
! [remote rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'E:/reps/gf.git'