Sayyiduna Rafi' bin Khadij (may Allah be pleased with him) said: The Prophet (peace and blessings be upon him) would not rise from a gathering without saying: "Subhanaka Allahumma wa bihamdika, astaghfiruka wa atubu ilayk (Glory be to You, O Allah, and with Your praise; I seek Your forgiveness and turn to You in repentance)." Then he would say: "These words are an expiation for (the shortcomings) that occur in the gathering."
Hadith Referenceالمعجم الكبير للطبراني / باب الراء / 4430