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.
كَانَ أَهْلُ الْكِتَابِ يَسْدُلُونَ أَشْعَارَهُمْ وَكَانَ الْمُشْرِكُونَ يَفْرُقُونَ رُءُوسَهُمْ وَكَانَ رَسُولُ اللَّهِ ﷺ يُحِبُّ مُوَافَقَةَ أَهْلِ الْكِتَابِ فِيمَا لَمْ يُؤْمَرْ بِهِ فَسَدَلَ رَسُولُ اللَّهِ ﷺ نَاصِيَتَهُ ثُمَّ فَرَقَ بَعْدُ