The People of the Book used to let their hair hang down, while the polytheists used to part their hair. The Messenger of Allah ﷺ liked to agree with the People of the Book in matters concerning which he had received no specific instruction, so the Messenger of Allah ﷺ let his forelock hang down. Later, he parted his hair.
حدثنا يعقوب حدثني أبي عن الزهري عن عبيد الله بن عبد الله
كان أهل الكتاب يسدلون أشعارهم وكان المشركون يفرقون رءوسهم قال وكان رسول الله ﷺ يعجبه موافقة أهل الكتاب في بعض ما لم يؤمر به فيه فسدل رسول الله ﷺ ناصيته ثم فرق بعد