«كان لا يقوم من مجلس إلا قال: سبحانك اللهم ربي وبحمدك لا إله إلا أنت أستغفرك وأتوب إليك وقال: لا يقولهن أحد حيث يقوم من مجلسه إلا غفر له ما كان منه في ذلك المجلس»
It was the practice of the Prophet (peace and blessings be upon him):
"Whenever He (peace and blessings be upon him) rose from a gathering, he would always say: 'Subhanakallahumma Rabbi wa bihamdika, la ilaha illa anta, astaghfiruka wa atubu ilayk' (Glory be to You, O Allah, my Lord, and with Your praise; there is no true god but You; I seek Your forgiveness and I turn to You in repentance). And he (peace and blessings be upon him) said: Whoever says these words when rising from his gathering will be forgiven the slips he committed in that gathering."
Hadith Referenceصحیح الجامع الصغیر / حرف الكاف / 4867