Undo operation 1. last modification submitted
Sometimes, after we submit the file, we find that a few files are missing, or the submitted information is wrong. You can use-- AmendOption resubmit:
$ Git commit -- Amend
If you directly run this command, you will have the opportunity to re-edit the submission instructions, but the file snapshot to be submitted is the same as the previous one.
If you forget to save some modifications when submitting the file, you can first add the temporary operation and then run it.-- AmendSubmit
$ Git commit-m'initial commit'
$ Git add forgotten_file
$ Git commit -- Amend
The preceding three commands generate only one commit, and the second commit command fixes the first commit content.
2. Cancel saved files
How to cancel files in the temporary storage area
In fact,Git statusThe command output tells us how to do it.
Git reset head <File>...Cancel temporary storage
Cancel modified files in the working directory
Git statusThe specific Undo method is also prompted.
$ Git checkout -- benchmarks. Rb