Jabir bin Yazid reported,

I was present with the Messenger of Allah ﷺ for the dawn prayer at Masjid al-Khayf. When he had finished his prayer, he noticed two men at the back of the gathering who had not prayed with him. He said, "Bring them to me."They were brought forward, trembling with fear.He asked, "What kept you from praying with us?"They replied, "Messenger of Allah, we had already prayed at our camp."He said, "Do not do that. If you have prayed at your camp and then come to a congregational mosque, pray with them. It will count as a voluntary prayer for you."

Nasai 859

Sahih

أخبرنا زياد بن أيوب قال حدثنا هشيم قال حدثنا يعلى بن عطاء قال حدثنا

جابر بن يزيد بن الأسود العامري عن أبيه قال

شهدت مع رسول الله ﷺ صلاة الفجر في مسجد الخيف فلما قضى صلاته إذا هو برجلين في آخر القوم لم يصليا معه قال علي بهما فأتي بهما ترعد فرائصهما فقال ما منعكما أن تصليا معنا قالا يا رسول الله إنا قد صلينا في رحالنا قال فلا تفعلا إذا صليتما في رحالكما ثم أتيتما مسجد جماعة فصليا معهم فإنها لكما نافلة

النسائي 859صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Leadership
Chapter
Repeating Fajr with the congregation for one who prayed alone
Numbering
Darussalam 859
Nasai 859