"You have heard that it was said, 'Eye for eye, and tooth for tooth.' But I tell you, do not resist an evil person. If anyone slaps you on the right cheek, turn to them the other cheek also. And if anyone wants to sue you and take your shirt, hand over your coat as well. If anyone forces you to go one mile, go with them two miles. Give to the one who asks you, and do not turn away from the one who wants to borrow from you. You have heard that it was said, 'Love your neighbor and hate your enemy.' But I tell you, love your enemies and pray for those who persecute you, that you may be children of your Father in heaven. He causes his sun to rise on the evil and the good, and sends rain on the righteous and the unrighteous."—Matthew 5:38-45
The first thing we must note after reading this passage is that such behavior is humanly impossible. No mere mortal can perfectly behave as Jesus was teaching—but that is just his point! In the face of the overbearing legalism of his day, Jesus was saying that religious demands to become righteous and attempts to produce righteousness fell far short of the goal of perfection. In this part of the Sermon on the Mount he responded to performance-based religion, and effectively said: "OK—you want to be righteous? Then here's what you will need to do."
This radical and extreme, humanly impossible to produce standard of righteousness he proclaimed is his way of explaining that authentic Christianity can only be given to mere mortals through the new life God grants us, by his grace. This impossible-for-humans-to-produce righteousness is produced in and through us when the risen Lord Jesus lives within us. Having said that, as we read this passage it's obvious that Jesus is teaching us that those who are his followers, those in whom he lives his risen life, those who are transformed from sin and death to love and life, will not seek retribution.