Allah Almighty says: "Except for those who repent before you overpower them." [Surah al-Ma'idah: 34]
Imam al-Shafi'i (may Allah have mercy on him), reporting from some of his companions, said that they said: "Every hadd that is a right of Allah Almighty is dropped by the (offender's) repentance, and every right that belongs to people is not annulled."
Imam al-Shafi'i (may Allah have mercy on him) said: "And this is what I hold too."
Sa'id bin Jubayr (may Allah have mercy on him) said: Whoever commits highway robbery is the one who wages war. He also said: If he has only killed, he is to be killed; if he has taken property along with killing, he is to be killed and then crucified; if he has only taken property and not killed, his hand and foot are to be cut off. If he repents, that is between him and Allah, and the hadd will (still) be established.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السرقة / 17319