Yehudah sinned by having relations with Tamar who he thought was a prostitute (see Gen. chapter 38). Because she was in fact his former daughter-in-law, at that time this relationship was actually considered a mitzvah as it fulfilled the concept of Yibum (the Levirate marriage). However, because Yehudah was not aware of her true identity, it was regarded as a sin on his part (Ramban on Gen. 38:26). When Tamar was about to be burned alive for becoming pregnant while awaiting her Levirate marriage and Yehudah realized that he was the father of the babies, he publicly admitted it, thus saving her life. He did this even though it was very embarrassing for him (see Shivlei Haleket ibid).
Admitting the Truth Despite Personal Loss
Yehudah’s teshuvah was unique in that he publicly admitted to his sin despite the fact that it sullied his reputation. He did so because he recognized the truth and had the strength of character to admit it. In truth, this admission was of personal benefit to himself as he thus saved his own progeny. In point of fact, though, he could have pardoned Tamar using a different excuse instead of admitting the whole truth, but Yehudah had the trait of honesty and was willing to face embarrassment rather than obfuscate the truth (see insights on the Artscroll Mesorah Bereishit Rabbah 99:8 in the name of Rabbi Shalom Schwadron.)