All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
The Hadeeth that is mentioned in the question was narrated by Al-Bukhari and Muslim. The Hadeeth is not directed at the women who do not wear the Hijab nor does it concern the time before the Hijab was made obligatory. Rather, this Hadeeth urges women to attend the ‘Eed prayer so that they witness its goodness and attend the prayer of the Muslims. But since some women were unable to go out because they did not have a Jilbaab (long outer garment) to go out with, perhaps due to being poor, then one female Companion asked the Prophet, sallallaahu ‘alayhi wa sallam, said “What about if one of us does not have a Jilbaab?” The meaning is: What shall she do in this case? Then the Prophet, sallallaahu ‘alayhi wa sallam, replied: “Let her sister cover her with her Jilbaab.” The meaning is: Let her sister lend her a Jilbaab which she does not need.
Allaah Knows best.