Workflow
git checkout -b _new_branch_name
git checkout master git branch -d _new_branch_name
Fortunately, you can easily recover from this mistake.
git reflog
395b1ea HEAD@{0}: checkout: moving from _master_cleanup_akismet to _master_cleanup
bd7df04 HEAD@{1}: commit: spam handling using akismet for form submissions on contact_submission and applicant models
395b1ea HEAD@{2}: checkout: moving from _master_cleanup to _master_cleanup_akismet
395b1ea HEAD@{3}: commit: cleaning up and adding some basic features
a828ef3 HEAD@{4}: checkout: moving from master to _master_cleanup
Should show you a list of commits across all branches in desc chronological order.
To merge the branch you just deleted you can give merge the sha.
git merge bd7df04Which would match the commit at HEAD@{1}
Just finishing up brewing up some fresh ground comments...