Smart Checkout and force checkout in Git

Smart Checkout and force checkout in Git
insert image description here
use git for code version management. When we switch branches , we sometimes encounter such problems:

This is because the code has been modified in the current branch, but there is no commit , so this window will pop up when switching to other branches.

Prompt you to choose force checkout or smart checkout. How to deal with it?

don`t checkout is not to cut the branch, stay in the current branch;

Smart checkout will bring the content of the conflict to the target branch (if you don't click on the files in the window to handle the conflict);

Force checkout will not bring the content of the conflict to the target branch, but all the content you modified in the current branch will be lost, even if you switch back, you will not be able to find it, so you need to operate with caution.

Lost code retrieval after force checkout
You can retrieve the code through the following steps (after retrieval, you need to check for errors and omissions by yourself)

1. Right click on the project folder. Click local history->show history
insert image description here
2. Then find the time before checkout
insert image description here
3. Right-click the option and click revert

Guess you like

Origin blog.csdn.net/Roinli/article/details/132543061