install – Reinstall Mac OS. Will the time machine really work?

I installed many OSS packages when I got my new MacBook. After many updates and 2 operating system updates, the XCode command-line tools REALLY have been corrupted. IT thinks it is installed. But everything I try to do says that CLT is NOT installed. I have tried with GREAT prejudice to remove XCode and reinstall. Mainly all I have done is lose the source code of my website. But CLT is still not usable.

Now I am about to reinstall 10.14. I have a backup of the time machine, but I have never tried to use it to recover a complete machine before.

Will this really work? Right now I'm pretty stuck like Ruby, but if I'm going to have to start from scratch in the configuration, I'll do it with nothing.

Opinions about reinstalling bare metal?