Undoing changes

You already know how to put files in the index and make a commit. This lesson goes the other way: see line by line what changed, take a file back out of the index, roll back an edit you regret, rewrite the message of the last commit, and tell git which files it should not notice at all - even ones it already tracks by an oversight.

What is already set up

The sandbox holds a repository ~/report with three commits, and the commit name and email are already configured. report.txt is a four line report for the third quarter, fully in history. notes.txt is in history too, but one more line has been appended on top of it and never saved. secrets.env is in history as well - a config file with an access token, committed by an ove

Free with account

Finish this lesson with a free account

This lesson is free once you sign in. Create an account to keep reading and open the lab.

Create a free account

Already have an account? Sign in