gitlab retrieves deleted branches

When cleaning the branch, I accidentally deleted the feature branch that has not been merged into the main branch, and finally used the method of git to restore the branch to successfully retrieve the code.

Here, the content of the reference article is directly used for explanation, as a backup of notes.

The following content is taken from https://www.jianshu.com/p/8f8b26484696

1. Find the commitId of the last commit of the branch, in the activity menu of gitlab:

insert image description here

2, Open git in the project code folder and execute git checkout -b branchname commitId

3, push to the remote branch
insert image description here

Guess you like

Origin blog.csdn.net/xwd127429/article/details/121009539