(Al-Hajj) 22 : 60
ذَٰلِكَ وَمَنْ عَاقَبَ بِمِثْلِ مَا عُوقِبَ بِهِ ثُمَّ بُغِيَ عَلَيْهِ لَيَنْصُرَنَّهُ اللَّهُ ۗ إِنَّ اللَّهَ لَعَفُوٌّ غَفُورٌ
That is, whoever is retaliating, he may retaliate with the equivalent of which he was harmed; then if he is oppressed upon it; Lord Allah will surely help him, indeed Allah is the Pardoning, Forgiving.
See explanation 16: 126-128.