Tit for tat is an idiom that means to do what somebody has done to you.