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.
https://www.etymonline.com/word/head over heels
aka. Ass over Tea Kettle