Is what I heard true that if one speaks lashon hara, even once, on someone else, he gives away all his mitzvos that he has done in his life and gets the other person’s aveiros? Is that meant literally and how is that fair since generally the rule is that aveiros don’t cancel out mitzvos and vice versa? It’s very discouraging that one can work his whole life in torah and mitzvos and then lose all that through one time slipping up and speaking lashon hara.
What you heard is partially true. The chofetz Chaim in Shmiras Halashon, ( Shar Hazechira 3) brings the Chovos Halvavos (Shar Hakniyah) that when a person talks lashon hora SOME of his mitzvos go to the other person, and when a person is talked about he gets some of the other persons mitzvos. Therefore even if a person made a mistake and spoke lashon hora he is not going to lose his life’s work, jhowever it is causing him considerable damage. I remember once hearing, although I can not confirm it, that this punishment that some of the person’s mitzvos go to the other person, only applies if the person did not do teshuva, but if he did do teshuva, then he does get his lost mitzvos back.