एक कमेटी से नई कमेटी में परिवर्तन करने वाले राज्य
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
राज्य परिवर्तन के लिए कार्रवाई
0->1: manual file/directory operation
1->2: git add .
2->3: git commit -m "xxx"
जाँच अलग
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
लास्ट कमिट में वापस
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
कुछ भी फिर से डाउनलोड किए बिना, जीआईटी क्लोन के बराबर
git reset && git checkout . && git clean -fdx