´It was narrated from 'Aishah:` "The Messenger of Allah (ﷺ) used to put his head out of the Masjid while he was performing I'tikaf, and I would wash it, while I was menstruating."
Hadith ReferenceSunan an-Nasa'i / The Book of Menstruation and Istihadah / Hadith: 388