Abdullah bin Abbas reported,

The Messenger of Allah ﷺ used to let his hair hang down loose, while the polytheists used to part their hair. The Messenger of Allah ﷺ liked to align with the People of the Book in matters about which he had not been given any specific instruction. Later, the Messenger of Allah ﷺ began parting his hair.

Nasai 5240

Sahih

أخبرنا محمد بن سلمة قال حدثنا ابن وهب عن يونس عن الزهري عن عبيد الله بن عبد الله

عن ابن عباس

أن رسول الله ﷺ كان يسدل شعره وكان المشركون يفرقون شعورهم وكان رسول الله ﷺ يحب موافقة أهل الكتاب فيما لم يؤمر فيه بشيء ثم فرق رسول الله ﷺ بعد ذلك

النسائي 5240صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Adornment from the sunnahs
Chapter
Parting the hair
Numbering
Darussalam 5240
Nasai 5240