If the working area and staging area files are changed, save them, ignore these changes, and return to the last submitted state. You can use git stash.
Assume that there is a file T in the project and it is first deleted from git rm t. This file disappears in the working area.
Then execute the GIT stash command and check the working area again.
At this time, call the GIT stash LIST command and you will see:
Git stash liststash @ {0}: WIP on Master: 1c47165 change package name
This change was not completely lost, but saved to the stash list. It can be considered that the dispute is put on hold and personal opinions are retained. Although they have obeyed the overall situation, there is still a stash list for personal opinions, which can be taken out at any time in the future.
Use git stash pop,
Removing T # on Branch master # changes not staged for commit: # (use "Git Add/Rm <File>... "To update what will be committed) # (use" Git checkout -- <File>... "To discard changes in working directory) # deleted: T # untracked files: # (use" Git add <File>... "to include in what will be committed?##deploy.tar.bz2 no changes added to commit (use" Git Add "and/or" Git commit-a ") dropped refs/stash @ {0} (bytes)
The result shows that I deleted the T file with GIT RM again.