When and why did "girl" come to mean young woman, and not just "child"?

by Vladith

In Samuel Pepys' diary, he refers to a young woman as a "girl", during a recollection of the time his wife caught him having an extramarital liason. However, the television show QI insists that until the 18th century or so, "girl" just meant a child of any gender. What is the origin of the use of "girl" to mean a young woman?

MooseFlyer

Might be better off asking in /r/linguistics or /r/etymology. My understanding is that the shift occurred much earlier than QI suggests - that gender-neutral "girl" was feature of Middle English, a period which ended around the end of the 15th century.