TIL you can clone a specific branch with git.
git clone -b my-branch --single-branch git@github.com:user/myproject.git
TIL you can switch back to the previous branch by running git switch -.
git switch -