// Add the program to the repository$ git add example.txt// or add all$ git add .$ git commit -m "Initialize"$ git commit --a -m "Initialize"// Check the status of the repository$ git status
// Revert the changes in the working directory$ git checkout example.txt// Get the hash for previous verisons$ git checkout <hash>// Return the latest verion in the master branch$ git checkout master
Tags
$ git tag$ git tag oops$ git tag -d oops$ git tag v1$ git checkout v1
Reset
// Reset the Staging Area$ git reset HEAD example.txt$ git reset --hard v1
Revert
$ git revert HEAD
Navigation
// Moving the `example.txt` file into a `src` directory$ mkdir src $ git mv example.txt src// Remove file `example.txt`$ git rm example.txt
// The `.git` directory$ ls -C .git// The Object Store$ ls -C .git/objects// Deeper into the Object Store$ ls -C .git/objects/<Directory>// Config file$ cat .git/config// Branches and Tags$ ls .git/refs$ ls .git/refs/heads$ ls .git/refs/tags$ cat .git/refs/tags// The HEAD file$ cat .git/HEAD