Ibn Abbas reported that the People of the Book used to let their hair fall (on their foreheads) and the polytheists used to part them on their heads, and Messenger of Allah ﷺ liked to conform his behaviour to the People of the Book in matters in which he received no command (from God) ; so Messenger of Allah ﷺ let fall his hair upon his forehead, and then he began to part it after this. (Using translation from Muslim 2336a)
«أَنَّ رَسُولَ اللَّهِ ﷺ كَانَ يَسْدِلُ شَعْرَهُ وَكَانَ الْمُشْرِكُونَ يَفْرُقُونَ رُءُوسَهُمْ وَكَانَ أَهْلُ الْكِتَابِ يَسْدِلُونَ وَكَانَ رَسُولُ اللَّهِ ﷺ يُحِبُّ مُوَافَقَةَ أَهْلِ الْكِتَابِ فِيمَا لَمْ يَنْزِلْ عَلَيْهِ فَفَرَقَ رَسُولُ اللَّهِ ﷺ»