1726, "a curious perversion" [Weekley] of Middle English heels over head (late 14c.) "somersault fashion," hence "recklessly." Head (n.) and heels long have been paired in alliterative phrases in English, and the whole image also was in classical Latin (per caput pedesque ire). Also compare tail-over-top and top-over-tail, both forms attested from mid-14c.