In addition to Weibo, there is also WeChat
Please pay attention

WeChat public account
Shulou
2025-11-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Today, I will talk to you about the example analysis of Git revoking commit and add and forced fallback, which may not be well understood by many people. in order to make you understand better, the editor has summarized the following for you. I hope you can get something according to this article.
1. Cancel after commit, do not undo add, and do not delete the changed code.
Git reset-- soft head ^
2. Undo add, or undo add after execution of 1
Git reset HEAD
3. Undo add and commit, and delete the change code
Git reset-- hard head ^
4. Undo push after remote (there is a way to reverse modify the record)
Operate revert on gitlab, or git revert-n version number
In this way, the revision of the version number is reversed to generate one more submission record.
5. Cancel the push to the remote branch (delete the submission method, provided that the branch cancels the branch protection)
First use git log to see the version number to be returned.
Git reset-- soft version number is being operated locally
Finally, execute the git push origin version number-- force
After reading the above, do you have any further understanding of the example analysis of Git undoing commit and add and forced fallback? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope





About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.