The Prophet ﷺ said to her, while she was menstruating, "Undo your hair and perform the ritual bath." In Ali's version of the hadith, he said, "Undo your head."
حدثنا أبو بكر بن أبي شيبة وعلي بن محمد قالا حدثنا وكيع عن هشام بن عروة عن أبيه
أن النبي ﷺ قال لها وكانت حائضا انقضي شعرك واغتسلي قال علي في حديثه انقضي رأسك
No references are available.
[Its isnad is sahih] Ibn Abu Shayba narrated it in 1/79, with this wording, and Majd Ibn Taymiya and others graded it sahih, and its basis is found in Sahihayn.