The high level of self-restraint that Imam Ali (a.s.) had towards those who wrong Islam and him personally can be seen in many events during his life.
This also embodied in the last days of his noble life when although he was suffering from the painful strike of Ibn Muljam's poisoned sword, he still made sure the perpetrator was treated with compassion and fairness.
The details of this can be read in:
Sheikh al-Mufid's Kitab al-Irshad [The Book of Guidance], biography of Imam Ali (a.s.).
Bihar al-Anwar, vol. 42, p. 288.