The slave woman of Ibrahim bin Abdur Rahman asked Umm al-Mu'minin Sayyida Umm Salama (may Allah be pleased with her): "My garment hangs low and long, and sometimes I happen to walk in an impure place." So Sayyida Umm Salama (may Allah be pleased with her) said: The Messenger of Allah (peace and blessings be upon him) said: "What comes after it purifies it."
Related hadith on this topic