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 is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
We do not know any particular supplication from the Book of Allaah or the Sunnah of the Prophet that one has to say in the circumstance mentioned in the question. However, good moral standards necessitate that a person has to apologize if he wrongs another person willingly or unwillingly. It is not befitting not to apologize for such a mistake because if one does not do so, he is neglecting and undermining people. The Prophet said: "Treat people with a good moral character." Once Al-Muhaajir Ibn Qunfuth, passed by the Prophet while the latter was urinating, and he greeted him with Salaam. The Prophet did not respond to him until he made ablution and then apologized to him and told him that he did not want to mention Allaah (by responding to the Salaam) in a state of impurity. [Abu Daawood].
Allaah knows best.