The Prophet ﷺ used to let his hair hang loose over his forehead, while the polytheists used to part their hair. The Prophet ﷺ liked to conform to the People of the Book in matters about which he had received no revelation, so the Messenger of Allah ﷺ let his hair hang loose at first. Later, he parted his hair.
حدثنا عثمان بن عمر حدثنا يونس عن الزهري عن عبيد الله بن عبد الله
أن النبي ﷺ كان يسدل شعره وكان المشركون يفرقون رءوسهم وكان النبي ﷺ يحب موافقة أهل الكتاب فيما لم ينزل عليه ففرق رسول الله ﷺ رأسه