First, we'll try to undo the latest commit in the repository as though it never happened:
- We'll make sure that our working directory is clean, no files are in the modified state, and nothing is added to the index:
$ git status On branch master Your branch is up-to-date with 'origin/master'. nothing to commit, working directory clean
- Also, check what is in our working tree:
$ ls HelloWorld.java Makefile hello_world.c
- If all works well, we'll check the log to see the history of the repository. We'll use the --oneline switch to limit the output:
$ git log --oneline 3061dc6 Adds Java version of 'hello world' 9c7532f Fixes compiler warnings 5b5d692 Initial commit, K&R hello world
- The most recent commit is the 3061dc6 ...