Git is great because it saves a log of basically everything you commit.
-
Find your commit in “.git/logs/HEAD” and open in a text editor
-
Find your SHA in the HEAD file
3c8c… 2260dc… Full Name {my.email@email.com} 1471276956 -0600 commit: Saving Trial 1,2,3
-
Type (note type enough of the sha so git knows which one to pull):
git checkout -b recovery 2260d…
See link for reference: http://blog.screensteps.com/recovering-from-a-disastrous-git-rebase-mistake