When you have done something you cannot undo
Mūsā ﷺ said this having killed a man with one blow he never intended to be fatal.
قَالَ رَبِّ إِنِّى ظَلَمْتُ نَفْسِى فَٱغْفِرْ لِى فَغَفَرَ لَهُۥٓ ۚ إِنَّهُۥ هُوَ ٱلْغَفُورُ ٱلرَّحِيمُ
Rabbi innī ẓalamtu nafsī fa-ghfir lī…
“He said, "My Lord, indeed I have wronged myself, so forgive me," and He forgave him. Indeed, He is the Forgiving, the Merciful.”
Where this comes from
He struck once, to break up a fight, and the man died. He does not explain himself or argue that he did not mean it. He says he wronged his own soul and asks to be forgiven. So He forgave him. In the same verse.
Source
The Qur'an · 28:16
Qur'an
- Qur'anic text in the Uthmani script via Quran.com; translation: Saheeh International