In Git, how can you recover a deleted branch that was not merged?
- git branch -d branch_name
- git checkout -b branch_name
- git reflog
- git branch branch_name commit_hash
To recover a deleted branch that was not merged, you can use git reflog to view the history, find the commit hash where the branch was deleted, and then recreate the branch using git branch branch_name commit_hash.
Loading...
Related Quiz
- How does the 'Gitflow' branching strategy differ from 'feature branching'?
- How does Git enable version control for database schema changes?
- The git stash ________ command allows you to view all the stashed changes in the repository.
- In Git, __________ tools can be integrated into the CI/CD pipeline to automate code quality checks.
- What is a common challenge when transitioning a legacy codebase to Git?