Add to Staging Area (stage)
git add <file>
To view the staging area status of a workspace
git status
Submit from staging area to latest version
git commint-m "comment"
Compare the differences between the latest version of the workspace and the repository:
git diff HEAD--readme.txt
View history, you can append parameters to each record line display:--pretty=oneline
git log
Fallback to previous version (plus one ^ for the last version)
git reset--hard head^
Back to a version according to Hashcode
git reset--hard 11801df
Undo the modification of the workspace (not the staging area), essentially replacing the workspace version with the version in the repository
Git checkout--readme.txt
Undo the Staging area changes (Unstage) and put them back in the work area.
git Reset HEAD readme.txt
Delete a file from the file system and repository
RM test.txtgit RM test.txtgit commit-m "Remove Test.txt"
Common Git Commands