When you go back to a previous version,
$ git checkout HEAD~2
Previous HEAD position was 363a8d7... Fixed a bug #32
You can see your feature log(hash) with this command even in this situation;
$ git log master --oneline -5
4b5f9c2 Fixed a bug #34
9820632 Fixed a bug #33
...
master
can be replaced with another branch name.
Then checkout it, you'll be able to get back to the feature.
$ git checkout 4b5f9c2
HEAD is now at 4b5f9c2... Fixed a bug #34