Step 4

You can use the following command to reset (revert changes) to an earlier commit where <commit> is a commit ID:

git reset --hard <commit>

For example, I will reset my repository to the commit I've made after adding a description of this app (before linking to the sleepyti.me URL).

git reset --hard 79cbc98629aa98b11003c48b5a3a4cf79c78f292 

Looking at the log (using git log --pretty=oneline), I get the following:

79cbc98629aa98b11003c48b5a3a4cf79c78f292 (HEAD -> master) Add description of the app
f034c1ea747a6ab6726681d60a7bd5b097ff40b8 Create README file

Also, looking at the README.md, the changes I've made (URL addition) are gone! It is like I traveled back in time!

There are other commands, namely git revert and git checkout, that can be used to undo change in your repository. Consult this tutorial to learn more about each.

Let's add the link to the sleepyti.me URL again. Let's also add that line about the technology used for building SleepTime App. Then, commit the changes:

git commit -am "Update description"

Look at the logs now:

03fefbc9cb2549b123cf16f9dc49eef3a19552d8 (HEAD -> master) Update description
79cbc98629aa98b11003c48b5a3a4cf79c78f292 Add description of the app
f034c1ea747a6ab6726681d60a7bd5b097ff40b8 Create README file

The last commit message is an example of a poor commit message! You should avoid using general descriptions like the one I just used and instead use more specific messages (like those I wrote earlier).

I recommend reading How to Write Good Commit Messages: A Practical Git Guide.