Messenger of Allah ﷺ used to let his hair hang down while the infidels used to part their hair. The people of the Scriptures were used to letting their hair hang down and Messenger of Allah ﷺ liked to follow the people of the Scriptures in the matters about which he was not instructed otherwise. Then Messenger of Allah ﷺ parted his hair. (Using translation from Bukhārī 3558)
أَنَّ رَسُولَ اللهِ ﷺ كَانَ يَسْدِلُ شَعْرَهُ وَكَانَ الْمُشْرِكُونَ يَفْرُقُونَ رُءُوسَهُمْ وَكَانَ أَهْلُ الْكِتَابِ يَسْدِلُونَ شُعُورَهُمْ وَكَانَيُحِبُّ مُوَافَقَةَ أَهْلِ الْكِتَابِ فِيمَا لَمْ يُؤْمَرْ فِيهِ بِشَيْءٍ ثُمَّ فَرَقَ رَسُولُ اللهِ ﷺ رَأْسَهُ