Sahih al-Bukhari, Hadith 3558 ⓘ
Narrated Ibn `Abbas: Allah's Messenger 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 Allah's Messenger liked to follow the people of the Scriptures in the matters about which he was not instructed otherwise. Then Allah's Messenger parted his hair.
حَدَّثَنَا يَحْيَى بْنُ بُكَيْرٍ، حَدَّثَنَا اللَّيْثُ، عَنْ يُونُسَ، عَنِ ابْنِ شِهَابٍ، قَالَ أَخْبَرَنِي عُبَيْدُ اللَّهِ بْنُ عَبْدِ اللَّهِ، عَنِ ابْنِ عَبَّاسٍ ـ رضى الله عنهما أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم كَانَ يَسْدِلُ شَعَرَهُ، وَكَانَ الْمُشْرِكُونَ يَفْرُقُونَ رُءُوسَهُمْ فَكَانَ أَهْلُ الْكِتَابِ يَسْدِلُونَ رُءُوسَهُمْ، وَكَانَ رَسُولُ اللَّهِ صلى الله عليه وسلم يُحِبُّ مُوَافَقَةَ أَهْلِ الْكِتَابِ فِيمَا لَمْ يُؤْمَرْ فِيهِ بِشَىْءٍ، ثُمَّ فَرَقَ رَسُولُ اللَّهِ صلى الله عليه وسلم رَأْسَهُ.
also referenced under: Book 61, Hadith 67 (In-Book) & Volume 4, Book 56, Hadith 758 (USC-MSA)