Q:

How to revert a state of a remote git reposity to a given commit?

I have branches A and B, both derived from master commit 123. 
Then I changed branch A and commit some changes to it. Now branch A is:
123 -> 456
Then I changed branch B and commit other changes to it. Now branch B is:
123 -> 789
I would like to reset branch A to master, so the differences between branch A and B would be just 789. It's ok for me to discard 456. 
However, I wouldn't like to have to recreate the branch, as I am doing this to be able to reopen a pull request in github. 
How to do it?

A:

You can discard your "456 commit" using git reset --hard:
git checkout A 
git reset --hard HEAD~1
git push origin A (needs: -f as in force , if 456 is already pushed to remote)

