One of the main advantages when using a version control system is the ability to undo changes and return to a previous version. Git provides powerful approaches and control over managing your repository and it's history which we'll explore in this scenario.
In this scenario the environment has been created with a Git repository with a number of simple commits.
Scenario 4 - Undoing Changes
Step 1 - Git Checkout
When working with Git, a common scenario is to undo changes in your working directory. The command
git checkout will replace everything in the working directory to the last committed version.
If you want to replace all files then use a dot (.) to indicate the current directory, otherwise a list the directories/files separated by spaces.
git checkout to clear any changes in the working directory.