Would it be considered lying if you said something, discovered that it was wrong, then took it back? Would it be considered still a sin, since you said it?
By definition, lying involves intentional deceit. The Catechism of the Catholic Church (CCC) defines a lie as follows: “A lie consists in speaking a falsehood with the intention of deceiving” (CCC 2482); and “To lie is to speak or act against the truth in order to lead someone into error” (CCC 2483).
Since you thought you were speaking the truth and then, after discovering your error, you corrected yourself, you are not guilty of lying. There is no sin in this.