Git checkout command and switching commits, branches
The git checkout command in git can be used to switch to another branch, but also to an older commit on the same branch and back again. One of the major reasons to use source control to begin with is so that I can go back to any point in development to which a commit has been made. Another major feature of using git is branching, being able to create a whole other branch to make some changes that may or may not be merged down into the main master branch at some point.
The checkout command can then be used to switch the current head of the git folder to a given commit, it can also be used to switch back to the latest commit for a branch by just giving the branch name rather than a commit hash id. The git checkout command is then one of several commands that I or any developer that uses source control should be aware of. So it is worth it to write about a few simple examples of the git checkout command that have to do with typical use cases.