IDEA tips-Git rollback && force push && code retrieval

Title IDEA tips - Git rollback && force push && code retrievalInsert image description here

Insert image description here

Not committed locally

Add new file

delete

Insert image description here

change file

rollback

The first method
Insert image description here
The second method
Insert image description here
Switch the default change list
Insert image description here

Commit not pushed

undo commit

Only applies to the last commit to rollback
Insert image description here

drop commit

Insert image description here
rollback
Insert image description here

revert commit

Insert image description here
revert commit just eliminates the code but will create one more commit record
Insert image description here

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.
Insert image description here
Insert image description here
Select soft
Insert image description here
. All the content that needs to be rolled back is in the temporary storage area.
Insert image description here

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
Insert image description here
. , the changes are in the staging area
Insert image description here

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
Insert image description here
hard rollback, all commit records will no longer exist.
Insert image description here

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.
Insert image description here
Keep rollback is to roll back the committed changes and retain the local changes.
Insert image description here

commit && push

reset + force push

First return the local records
Insert image description here
, then push the local modifications to the remote code,
Insert image description here
and then submit the new code.
Insert image description here

code retrieval

Retrieve the Rollback code
Insert image description here
Insert image description here

Guess you like

Origin blog.csdn.net/qq_43409973/article/details/130569221