Git restores the deleted branch and content, and git restores the branch
Git Delete Branch
Git branch-D branch name
Git view branch git branch-
Git Delete remote branch git push origin: branch name
Note: If the git branch is submitted and pushed, but the branch is deleted, the items submitted on the branch are also deleted.
The correct sequence is: git commit = git checkout master = git merge branch name => git push
Resolution: Switch git to the master branch,
Merge the items on the branch,
Git push for pushing,
At this time, the master Branch has been merged and pushed,
The useless branches can be deleted normally.
If the git branch is deleted first,
But not merged,
Recovery Method:
First:
Git log-g // view all log records, find the commit id when the branch was submitted, and copy only the id
Git branch new branch name submit id // create a new branch. At this time, the new branch contains the content of the version just submitted.
Then
Git checkout master = git merge branch name => git push