Command
git checkoutExplanation
git checkout is used to switch branches or restore files. It switches branches or restores files.
Examples
Switch to main branch
git checkout mainCreate and switch to new branch
git checkout -b new-branchDiscard changes to file
git checkout file.txt