The title is not very clear. What I actually need to do often is the following:
Let's say I have a development going on with several commits c1,c2,... and 3 branches A,B,C
c1--c2--c3--(B)--c4--(A,C)
Branch A and C are at the same commit.
Now I want branch A to go back where B is, so that it loks like this:
c1--c2--c3--(A,B)--c4--(C)
Important is that this has to happen locally and on github.