Revert Git pull

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:

  • Git keeps prompting me for password
  • Possible to add a collaborator w/ push access only to a specific folder in a repo?
  • Can't start Git in OS X El Capitan
  • How to get a version tree for a file in git?
  • How might one “git describe” every commit?
  • Git unstage lines where the only changes is white-space?
  • (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.

  • Github merge --no-ff with Github for Mac app
  • git merge diffs application process compared to rebase
  • Alternate/multiple directory structure mappings within a git repository
  • How to initialize a new Scala project in sbt, Eclipse and github
  • Prevent pull/push from an obsolete Git repo and redirect to a new one
  • Can I make a user-specific gitignore file?
  • One Solution collect form web for “Revert Git pull”

    I want to forfeit commits C and D.

    You just need to git reset --hard HEAD~ to move back to the previous commit. --hard will discard all changes and give you a clean working directory.

    And can anyone tell me what is the better way to learn Git?

    Keep using it. Experience is the best teacher.

    Git Baby is a git and github fan, let's start git clone.