Guardian is the central French half of a pair whose Norman half is warden. Both go back to the same Germanic root meaning to watch over, borrowed into Frankish and then French. Norman French kept a w sound at the front; the French of Paris turned it into gu-. English took both forms and eventually gave them different jobs — a warden runs an institution, a guardian looks after a person.
English took this form in the early 1300s, spelled garden at first and gardein by the 1400s, from Anglo-French. The u appeared later, following the French convention of writing gu- to keep the g hard. The specific legal sense, one appointed to care for a minor's person or property, dates from the 1510s; the guardian angel from the 1630s. Warranty and guarantee, catch and chase, and cattle and chattel are all the same trick.
guardian (n.) "one who guards," early 14c., garden ; early 15c., gardein , from Anglo-French gardein (late 13c.), Old French gardien "keeper, custodian," earlier guarden , from Frankish *warding- , from the Germanic source of guard (v.). Specific legal sense is from 1510s. Guardian angel is from 1630s. also from early 14c.