Please see the following suttas in relation to forgiveness:
In this sutta, the Buddha doesn’t accept the harm from another. Thus he doesn’t get inflicted to the point that he needs to Forgive.
And this sutta, number 21 the first section, shows the importance of understanding one’s own mistakes and forgiving others’ mistakes.
For more information on how to practice Forgiveness, see