I have a git repository that looks like this:
A <- B <- C <- D <- HEAD
I want the head of the branch to point to A, i.e. I want B
Similar to Jakub's answer, this allows you to easily select consecutive commits to revert.
# revert all commits from B to HEAD, inclusively $ git revert --no-commit B..HEAD $ git commit -m 'message'