You can do it with
Read more about this comand : https://www.w3docs.com/learn-git/git-reflog.html#Recovering
ou can do it in one step:
git checkout -b <branch> <sha>
To recover a deleted branch you need to find the commit which was the head of your deleted branch by running
You can then recreate the branch by running
git checkout -b <branch-name> <sha1-of-commit>
You will not be able to recover deleted branches if git’s garbage collector deleted dangling commits - those without refs. Always have a backup of your repository, especially when you work in a small team / proprietary project
- 1Which is the right way to reflect already pushed changes to local branch?
- 6how to check if object is empty or not.
- 2how to check is array symmetrical or not?
- 4How can I rename git local and remote branch name?
- 1How to rename Git local and remote branch name?
- 1Git - clone another project branch to current project
- 2how to check a number is prime or not. using js
- 2line-height property not work with hyperlinks?
- 1How to check does a specific branch contains a given commit in Git
- 1How to create a remote Git branch?