Git introduced switch
in version 2.23 to handle changing of branches specifically and avoid the use of checkout
which can be confusing by the sheer amount of operations it can do.
Among other possibilites,
git switch <branch> # to switch to an existing branch
git switch -c <new_branch> # to create a new branch and switch to it