I had serious problems from two versions of Xcode on the same machine. I removed all Xcode app instances & many other non-System 'xcode'-related files, then reinstalled the app (4.6.2), fixing my original problem. But xcodebuild and xcode-select are still not available, which I need to run PhoneGap for iOS. Within Xcode, the Preferences => Downloads => Command-line Tools item is marked "Installed", with no option to delete or re-install. I tried removing xcrun, but that didn't work. How do I fix this?
Did you try xcode-select?
The command line tools are installed like other OS X packages, so you may need to delete the receipt file from the receipts database (which used to be trivial since you could delete the file from /Library/Receipts but now is more complicated and needs a short article on the receipts database).
Rather than mess with that, why not just download the stand alone installer and wait for a new version of Xcode to clean up your receipts database for you?
This URL is fairly open (even the search engines can index it) but you might need to make a free Safari or free Mac developer account to log in and get this package.
If this happened to me, I'd simply change my Time Machine to exclude system files and then install a new OS onto a spare volume. I'd make a junk admin user that I'll delete and use that user to install Xcode and the command line tools and then finally restore from Time Machine. As long as everything worked, I'd clone that to my main drive or repeat the wipe/reinstall process - whichever is easier for you to perform.