Estados em transição de um commit para um novo commit
0. last commit,i.e. HEAD commit
1. Working tree changes, file/directory deletion,adding,modification.
2. The changes are staged in index
3. Staged changes are committed
Ação para transição de estado
0->1: manual file/directory operation
1->2: git add .
2->3: git commit -m "xxx"
Check diff
0->1: git diff
0->2: git diff --cached
0->1, and 0->2: git diff HEAD
last last commit->last commit: git diff HEAD^ HEAD
Reverter para a última confirmação
2->1: git reset
1->0: git checkout . #only for tracked files/directories(actions include modifying/deleting tracked files/directories)
1->0: git clean -fdx #only for untracked files/directories(action includes adding new files/directories)
2->1, and 1->0: git reset --hard HEAD
Equivalente ao clone git, sem baixar novamente nada
git reset && git checkout . && git clean -fdx