When working on a Git project, sometimes we make changes that we want to get rid of. Git offers a few eraser-like features that allow us to undo mistakes during project creation. In this lesson, we’ll learn some of these features.

To start out, let’s review the basic Git workflow.



You are in a Git project titled hamlet-prince-of-denmark. In the code editor, you’ll be working on scene-5.txt. Here, Hamlet encounters the ghost of his father. Add this text to the file:

Ghost: My hour is almost come, When I to sulphurous and tormenting flames Must render up myself.

From the terminal, add scene-5.txt to the staging area.

Here’s a hint on how to do it.


Commit the changes to the repository with a good commit message.

Here’s a hint on how to do it.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?