The easiest way to resurrect your commits is to point some branch head to them. You know the SHAs, so it's easy:
git branch resurrected_junk 1b8c11d
(this is a SHA read from your screenshot), could be also
git branch resurrected_junk HEAD@1
This will point a branch to the most recent of your lost commits - the earlier ones are probably parents of the most recent one, so they will be on this new branch; if they aren't (that means there are two "shadow branches" of lost commits), you would have to review all the commits and reiterate the procedure for the commits that are missing.
In your case, I guess you'll get a history like this:
Master --> Optimize toRGB --> ... ---> shortened toRGB = resurrected_junk
Then, refresh your gitk view and the commits should show up. (I'm using qgit, so I'm just guessing)
After that, you should be able to merge/push/whatever yow want them (as you like).