(Staging area = index in Git)
Commit to local respository content, do not want to push, then use git reset to turn the file state to staged|modified|unstaged:
git reset head^
git reset--soft head^
git reset head~3 (local 3 commit uncommitted, or git reset head^ operation 3 times)
State rotation with Git reset
The deleted content is not push to the remote position and you want to restore the file:
git checkout [--] <file or path> (--optional)
Git pull, some changes do not want to commit to the local warehouse, you can git stash, the following three steps:
1. Git stash
2. Git pull
3. Git stash pop
View the status of the current warehouse in a tree structure:
GITK--all &
git delete files:
1. Delete the file from the repository while the current working directory (disk) is also deleted
git rm <file>
Git rm-r <path>
2. Delete the file from the repository, but the file remains on the current working directory (disk)
git rm--cache <file>
git rm-r--cache <path>
File status and usage in git