In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to restore deleted branches of git", the content of the explanation is simple and clear, easy to learn and understand, now please follow the editor's ideas slowly in depth, together to study and learn "how to restore deleted branches of git"!
Git method to restore deleted branches: 1, using the "git reflog" command to find the last submitted record of the deleted branch; 2, using the "git checkout-b dev to obtain the deleted SHA value" command to restore the deleted branch.
This article operating environment: Windows10 system, Git2.30.0 version, Dell G3 computer.
How does git restore deleted branches
There are two possibilities for branches to be deleted, either with the command, which can be seen with git log, or when the browser merges branches, check the option to delete the source branch after merging.
1. View the deleted branches
Git remote prune-dry-run origin
The branch that was deleted is dev
2. Find the commit SHA value of the last submitted record of the deleted branch
Git reflog
The last submitted commit SHA value is 5f8fe57
3, restore the branch
1) use command to restore
Git checkout-b dev 5f8fe57
2) create a new branch directly based on commit SHA on Gitlab to restore the deleted branch
Thank you for reading, the above is the content of "how to restore deleted branches of git". After the study of this article, I believe you have a deeper understanding of how to restore deleted branches of git, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.