Print the path to the active developer directory (selected Xcode)
xcode-select -p
Select a different version of Xcode, e.g. Beta
sudo xcode-select -s /Applications/Xcode-beta.app
Reset to the default version of Xcode
sudo xcode-select -r
This is equivalent to running sudo xcode-select -s /Applications/Xcode.app
For more details: man xcode-select