The prayer is still valid and does not have to be redone.
According to Ibn Taymīya the prayer is only nullified if two conditions are true: if a highly inappropriate amount of the ʿawra (the part of the body that must be kept covered during prayer) is shown, and if that goes on for a long time (for the duration of the prayer or for most of it). Since a little hair is not a highly inappropriate amount, the first condition is not satisfied, so the prayer is still valid.
According to the Jordanian fatwa authority (representing the Shāfiʿī school, which is very strict in such matters), if the uncovered area is not immediately covered, the prayer is nullified.
According to the Egyptian fatwa authority (generally representing the opinions of the scholars of Al-Azhar University) the prayer is still valid as long as the area shown is not too much and as long as it is not out of gross negligence.
A fatwa on IslamWeb (managed by Qatar’s fatwa authority) dealing specifically with the issue of a woman unintentionally having some of her hair out during the prayer rules that it does not nullify the prayer even if it goes on for “a long time”, meaning for the duration of the whole prayer.