In a local repository.
1. add first.txt to repository, use Git bash
$ git add first.txt
2. commit change
$ git commit -m 'my first commit'3. check content change
$ git diff first.txt
4. commit change
$ git commit -m 'my second commit'
5. remove a file
$ git rm Documentation/\*.txt
6. test if the file exists and can be removed
$ $ git rm -n aa.txt
7. Revert the changes specified by the fourth last commit in HEADand create a new commit with the reverted changes.
git revert HEAD~3
8.revert a commit
git revert 64158c6f740083d89b25575c82e2413548e1a5f0