Git reset has two usage methods: one is to include the path in the Command <paths>. This method does not change the reference, nor does it change the workspace, instead, replace the files in the temporary storage area with files in the specified commit state, which is equivalent to canceling the previous git add operation.
Method 2: If path <paths> is not used, the reference is reset.
Command Format: git reset [-- soft | -- mixed | -- hard] [<commit>]
Parameter -- soft only changes the point of reference and does not change the cache and workspace.
Parameter -- mixed or no parameter is used to change the reference and reset the cache area but not the Workspace
Parameter -- hard not only changes the reference, resets the cache, but also changes the workspace.
Git reset head or git reset does not change the reference or workspace, but only updates the content previously updated to the staging area by using the GIT add command to be removed from the staging area
Git reset -- filename only removes the changes to the specified file from the temporary storage zone, and the workspace and Reference remain unchanged.
Git reset head ^ The workspace remains unchanged, and both the staging zone and reference are rolled back once.
Git reset -- hard head ^ unsubmit completely. The workspace, staging area, and reference are all returned to the last commit state.
I personally feel that git reset commands can be mastered only when they are used repeatedly at work.
Git reset command