It is not right to expect to be able to hide sin. Jesus berated the scribes and Pharisees for pretending to be what they were not. This is called hypocrisy.
Mat 23:25 “Woe to you, scribes and Pharisees, hypocrites! For you clean the outside of the cup and the plate, but inside they are full of greed and self-indulgence.
If you have said something that was untrue, and if you now realize that you made a mistake about it, or worse, if you have deliberately lied, then you would expect to set it right as far as possible. You are continuing the wrong if you refrain from admitting fault in order to protect yourself.
However there can be circumstances when serious damage can be caused by bringing something into the open. Sin’s damage cannot always be repaired. A person who is driven by a Godly conscience will do his or her best to achieve the best outcome, even if it is just the least worst.