1. Cancel this pull
git reflog
reset to a certain version
git reset --hard 91ae6ad
2. Cancel this merge
If you merge other branch codes and cause a lot of conflicts, you want to cancel this merge.
1. Use the reset command above to undo to the last submitted version
2. Execute the following command to directly cancel the local merge
git merge --abort
3. High-level usage of git log
View the file modification list submitted every time, and the graphical information of branch changes
git log --name-status --oneline --graph
General query usage
git log
4、git stash
In normal development, if a part of the local branch is developed, but the branch needs to be switched, or the code needs to be pulled, how to complete the pull or branch switch without submitting the modification?
git stash can temporarily store the current work status (WIP, work in progress) in the stash list, and then reapply these changes from the stash after the pull/merge operation is completed.
The -u parameter indicates that the newly added file is also stash
git stash save -u 'message'
\# View how many WIPs have been temporarily stored in the stash list
git stash list
\# Restore the last WIP status and remove it from the list
git stash pop
5. How to undo the modification
1. The use of checkout when revoking a newly created file or directory does not take effect
.
represents the files in the current directory and all subdirectoriesgit clean -fd .
Undo the specified file or directory
git clean -fd file or directory
2. Cancel the local update code modification
git checkout .
This is very commonly used, so I won’t repeat it too much.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。