It is permissible for men to grow their hair long and if need be to braid it as this act was done by Prophet the Prophet (peace and blessings of Allah be upon him), when his hair came down to his earlobes, and sometimes it reached his shoulders. When his hair grew long, he would put it in four braids.
Anas ibn Malik (may Allah be pleased with him) said: “The hair of the Messenger of Allah (peace and blessings of Allah be upon him) came down between his ears and his shoulders.”
(Narrated by al-Bukhari, 5565; Muslim, 2338)
It was narrated by Abu Dawood and al-Tirmidhi with a hasan isnad from Umm Hani who said: “The Messenger of Allah (peace and blessings of Allah be upon him) came to Makkah and he had four braids. This is to be understood as referring to times when he was so preoccupied that he could not take care of his hair for a long time, such as when traveling and the like.” (Fath al-Bari, 10/360)
It is obligatory in ablution to wipe the hair on the head, not to wash it, because Allah says:
(And wipe your heads) Al-Ma’idah 6
Based on this, it is not necessary to undo the braids for men or women, rather it is necessary to wipe the head from the hairline to the nape/neck, and it is not necessary to wipe what has come down from the nape/neck.
In ghusl, water must reach all over the body and into the soles of the hair, but the Prophet (peace and blessings of Allah be upon him) permitted if a person braids their hair, and they want to do ghusl, to pour water over their head so that it reaches the roots of their hair, and they do not have to undo their braids.
Umm Salamah narrated :
“I said: ‘O Messenger of Allah! I am a woman with tight braids on my head, should I undo them to perform Ghusl for Janabah? He said: ‘No. It is sufficient that you only pour three scoops of water (with hands held together) over your head, then pour water over the rest of your body, to be purified.'” Or he said: “Then you will be purified.”