Difficulty: Beginner
Estimated Time: 10 minutes

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.

This scenario demonstrated how you can reset and revert changes you've made and how to go back to a previous state.

This scenario has been added to your scrapbook where you can review the examples and commands you executed.

Scenario 4 - Undoing Changes

Step 1 of 5

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.


Use git checkout to clear any changes in the working directory.

This tab will not be visible to users and provides only information to help authors when creating content.

Creating Katacoda Scenarios

Thanks for creating Katacoda scenarios. This tab is designed to help you as an author have quick access the information you need when creating scenarios.

Here are some useful links to get you started.

Running Katacoda Workshops

If you are planning to use Katacoda for workshops, please contact [email protected] to arrange capacity.

Debugging Scenarios

Below is the response from any background scripts run or files uploaded. This stream can aid debugging scenarios.

If you still need assistance, please contact [email protected]