كتاب الصلاة
4  
The Book of Prayers
(44)
Chapter: The Limbs Of Prostration And The Prohibition Of Tucking Up One's Hair And Garment Or Having Ones Hair In A Braid When Praying
(44)
باب أَعْضَاءِ السُّجُودِ وَالنَّهْىِ عَنْ كَفِّ الشَّعْرِ، وَالثَّوْبِ، وَعَقْصِ الرَّأْسِ، فِي الصَّلاَة
Sahih Muslim 492

Abdullah b. Abbas reported that he saw 'Abdullah b. al-Harith observing the prayer and (his hair) was plaited behind his head. He ('Abdullah b. 'Abbas) stood up and unfolded them. While going back (from the prayer) he met Ibn 'Abbas and said to him:

Why is it that you touched my head? He (Ibn 'Abbas) replied: (The man who observes prayer with plaited hair) is like one who prays with his hands tied behind.
حَدَّثَنَا عَمْرُو بْنُ سَوَّادٍ الْعَامِرِيُّ، أَخْبَرَنَا عَبْدُ اللَّهِ بْنُ وَهْبٍ، أَخْبَرَنَا عَمْرُو بْنُ الْحَارِثِ، أَنَّ بُكَيْرًا، حَدَّثَهُ أَنَّ كُرَيْبًا مَوْلَى ابْنِ عَبَّاسٍ حَدَّثَهُ عَنْ عَبْدِ اللَّهِ بْنِ عَبَّاسٍ، أَنَّهُ رَأَى عَبْدَ اللَّهِ بْنَ الْحَارِثِ يُصَلِّي وَرَأْسُهُ مَعْقُوصٌ مِنْ وَرَائِهِ فَقَامَ فَجَعَلَ يَحُلُّهُ فَلَمَّا انْصَرَفَ أَقْبَلَ إِلَى ابْنِ عَبَّاسٍ فَقَالَ مَا لَكَ وَرَأْسِي فَقَالَ إِنِّي سَمِعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم يَقُولُ ‏ "‏ إِنَّمَا مَثَلُ هَذَا مَثَلُ الَّذِي يُصَلِّي وَهُوَ مَكْتُوفٌ ‏"‏ ‏.‏
Reference : Sahih Muslim 492
In-book reference : Book 4, Hadith 263
USC-MSA web (English) reference : Book 4, Hadith 996
  (deprecated numbering scheme)