Skip to content
This repository has been archived by the owner on Apr 28, 2019. It is now read-only.

Revive a deleted branch

czaloj edited this page Jan 3, 2015 · 1 revision

If you accidentally deleted a branch locally and remotely, the fix is relatively easy:

1. Open Git Bash Shell in repo
2. Type "git fsck --lost-found"
3. Type "ls .git/lost-found/commit/ | xargs git log > commitlog.txt"
4. search commitlog.txt for your commit
5. Type "git checkout -b <NewBranchName> <first 7 characters of commit ID>", where you supply both arguments inside the braces
Clone this wiki locally