(a) It is narrated from Sayyiduna Mu'awiyah bin al-Hakam al-Sulami (may Allah be pleased with him): I prayed with the Messenger of Allah (peace and blessings be upon him). A man standing beside me sneezed, and I said 'Yarhamuk Allah' (May Allah have mercy on you). The people began looking at me. I said: Woe is me, may my mother lose me! I am praying and you keep staring at me? They began striking their thighs with their hands; they wanted to silence me (so I fell silent). When the Messenger of Allah (peace and blessings be upon him) finished the prayer, may my parents be ransomed for him, I have never seen, before him or after him, a teacher more kind and gentle than him. By Allah, he neither struck me, nor scolded me, nor reviled me; rather he said: "This is the prayer; conversing with people is not proper in it. It is only for tasbih, tahmid and the recitation of the Qur'an."
(b) Imam al-Shafi'i (may Allah have mercy on him) states that it is not reported from the Prophet (peace and blessings be upon him) that he (peace and blessings be upon him) ordered him to repeat the prayer, since he had spoken in the prayer out of ignorance.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3352