Probably less elegant than other approaches here, but I've always used get reset --hard HEAD~N
to undo multiple commits, where N
is the number of commits you want to go back.
Or, if unsure of the exact number of commits, just running git reset --hard HEAD^
(which goes back one commit) multiple times until you reach the desired state.