Reputation: 12990
By accident I deleted local branch. Then I wrote over it with remote branch (same name), now all of the changes for the story are gone..
Is there any way to restoring the local branch i deleted?
$ git branch -D branch-name
$ git branch checkout branch-name
Help appreciated A lot
Upvotes: 0
Views: 38
Reputation: 66
Did you make any commits while on your original local branch? If so they might still be visible with git log
or git reflog
. If the most recent commit is still there you can apply it to the branch that you just created.
There's also a chance that the commits might accessible using git fsck --full
to detect if they are considered a dangling git object.
Hope this helps.
Upvotes: 3