I have a Git commit picture that looks like this:
(master)(origin/master)<---o
                           | \
                           |  \
                           |  |
                           |  |
                           |  o--->commit D
                           |  |
                           |  |
                           |  o--->commit C
                           |  |
                           |  |
               commit B<---o  |
                           |  |
                           | /
               commit A<---o/
                           |
                           |
                    earlier commits
I would like to turn it into:
(master)(origin/master)<---o--->commit B
                           |
                           |
                           o--->commit A
                           |
                           |
                    earlier commits
Can anyone help? I want to forfeit commits C and D. And can anyone tell me what is the better way to learn Git? It seems that I am often restrained by Git rather than being able to harness its power. Thanks.
 
    