Title IDEA tips - Git rollback && force push && code retrieval
Not committed locally
Add new file
delete
change file
rollback
The first method
The second method
Switch the default change list
Commit not pushed
undo commit
Only applies to the last commit to rollback
drop commit
rollback
revert commit
revert commit just eliminates the code but will create one more commit record
reset
soft
All changes made after selecting commit will be in the staging area, and the contents of the commit will be retained. All new files + file changes will be in the staging area.
The content that needs to be rolled back.
Select soft
. All the content that needs to be rolled back is in the temporary storage area.
mlxed
Changes made after selecting commit will be retained, but will not be temporarily saved for submission. The contents of the commit will be retained. The new files will be in the workspace, and the file changes will be in the staging area. mlxed will roll back the new files in the workspace
. , the changes are in the staging area
hard
All changes made after the selected commit will be discarded (staged and committed), and the contents of the commit + the contents of the staging area will be discarded. After
hard rollback, all commit records will no longer exist.
keep
The committed content after the selected commit will be discarded, but the uncommitted part will be retained. The committed
content will be discarded, and the uncommitted part will be retained.
Keep rollback is to roll back the committed changes and retain the local changes.
commit && push
reset + force push
First return the local records
, then push the local modifications to the remote code,
and then submit the new code.
code retrieval
Retrieve the Rollback code