How to use GitHub or GitLab In GIT
If you use a remote repository service like GitHub or GitLab, you might be able to restore a deleted branch from the web interface, provided it hasn’t been permanently removed.
GitHub:
- Go to the repository on GitHub.
- Click on the “Branches” tab.
- Scroll down to the “Recently deleted branches” section.
- Find the branch you want to restore and click “Restore”.
GitLab:
- Go to the repository on GitLab.
- Click on “Repository” > “Branches”.
- Scroll to the “Deleted branches” section.
- Click “Restore” next to the branch you want to restore.
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