how to change dotnet version

Shell
dotnet new globaljson --sdk-version [Type version number here] --force

version number examples:
- 2.1.509
- 3.0.100-preview-010184
Source

Also in Shell: