Han Chinese were not allowed to cut their hair because of filial piety, all the way until the Qing dynasty forced them to adopt the Manchu shaved-head-and-pigtail look. That was part of the reason for the fierce Han oppostion to the pigtail policy during the early Qing, which resulted in several rebellions. Men would tie their hair up in a topknot and enclose it with a headdress or cap (guan), while women would coif or plait it in various ways. However, shaving the beard or moustache was not considered unfilial, because one only developed them at puberty. Many Chinese men chose to grow out their beards and/or moustaches simply because they felt it looked good.
Imagine this - to the ancient Chinese, a person with short hair was probably an uncivilised barbarian!