The name comes from Middle English recordour, from Old French recorder ("to sing, repeat, learn by heart"), from Latin recordari ("remember, call to mind").
In the 14th–16th centuries, "to record" meant "to practice music" or "sing like a bird." The instrument—popular for teaching and amateur music—was the "recorder" because it was used to record (practice/rehearse) melodies.
Both mean "sweet flute"—referring to its soft, gentle tone compared to the louder shawm or trumpet.
The modern "recording" sense (capturing sound) developed later, but the instrument's name preserves the older meaning of "learning by heart."