How to use git cherry-pick In GIT
If the commit was in a branch that you still have, but you want to apply it to another branch, you can use git cherry-pick.
Steps: Check Out the Target Branch:
git checkout <target-branch>
Cherry-pick the Commit: Apply the commit to the current branch.
git cherry-pick <commit-hash>
How to Change a Git Commit Message After a Push?
Accidentally deleting a branch or commit in Git can seem alarming, but Git’s powerful version control capabilities often allow you to restore them with relative ease. This guide will walk you through the steps to recover a deleted branch or commit.
Table of Content
- Restoring a Deleted Branch
- Using GitHub or GitLab
- Restoring a Deleted Commit
- Using git cherry-pick
- Conclusion