What does someone do if he used to do something in Salah that made sajdah sahw wajib but he did not know until he read the masail few months later?

If he was ignorant out of innocence, and therefore made mistakes without causing harm then his salat will be considered correct; and, consequently, his past prayers will also be considered correct.
But if he was ignorant out of negligence in learning the Islamic laws or did mistakes which do invalidate the act in general then there is no way to validate his past prayers. Then he has to repeat them all.