In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
You are not required to repeat the prayer according to the situation that you described. Nevertheless, it is desirable for you to repeat it according to the Maliki school of thought if the time of the prayer has not expired.
Answering your question, The Fatwa Center at Islamweb, states:
If some of the woman’s hair is disclosed during the prayer, this does not make her prayer void if she covers it quickly.
Ibn Qudamah said in Al–Mughni:
“If the awrah of a woman’s hair is disclosed and she covers it on the spot without delay, then this does not make the prayer invalid.”
The woman’s hair is a part of her awrah and it is not permissible for her to disclose it during the prayer.
The Maliki School of thought are of the opinion that it is desirable for the woman to repeat her prayer immediately, if her head is revealed or some of her limbs.
The combined text of Al–Dardir and Khalil Ibn Ishaq said:
“The free woman should repeat her prayer for exposing her bosom or limbs, like neck, head, arms or her heels if they are exposed partly or wholly. The same thing applies to the back which is the part opposite the bosom, if exposed for a period (during the prayer).”
However, if the time of the prayer has expired, it is not desirable to repeat the prayer according to them.
The conclusion is that you are not required to repeat the prayer according to the situation that you described. Nevertheless, it is desirable for you to repeat it according to the Maliki school of thought if the time of the prayer has not expired.
You have to know that the obligation of covering the hair for a woman is not only during the prayer, but it is an obligation on her during the prayer and outside the prayer if she is in a place where she can be seen by strangers.
Almighty Allah knows best.