Assuming you committed your work (even if you never pushed it), and assuming that you still have the specific repository in which you originally did the work, you can probably recover your work using the reflog.  The reflog doesn't last forever, so this needs to be done soon after the work was "lost".
(If you did not commit your work - i.e. if it was only in your working tree and got lost before you did git add and git commit - then git does not have a record of it and you would have to rely on backups or other solutions outside of git.  And reflogs are local to a specific repo.  Neither reflogs nor "dangling commits" are typically shared during push/fetch/clone/etc.; and you need both of those things if you're going to recover anything.)
Anyway, if you say
git reflog
it will show a list of the commits that have recently been "the current commit".  If you can find the last commit you made, you can recover it (e.g. by creating a new branch with that SHA1 as the starting point).