How to undo console commands?

Thank you, but I don’t have a specific problem.

It’s just that, whenever I watch videos and tutorials, they say “insert the following command”, but they almost never say how to undo it or what is the default value.

So I am afraid to try these commands, because I don’t know how to undo the damage they may cause.