For doing so you just have to use the revert command, specifying the range of commits you want to get reverted.
Taking into account your example, you'd have to do this (assuming you're on branch 'master'):
git revert master~3..master
or git revert B...D
or git revert D C B
git revert B...D
This will create a new commit in your local with the inverse commit of B, C and D (meaning that it will undo changes introduced by these commits):
A <- B <- C <- D <- BCD' <- HEAD