I just want to record down the 2 common usages of git checkout so that I don’t need to refer again next time!
git checkout — <filename>
- this will overwrite your file with the name <filename> in your working directory with the <filename> from the staging area.
git checkout -f
- replace all the files in the working directory with files from HEAD
- clear the staging area to match with HEAD