I was working in VSCode and staged all changes (using the GitLens extension).
Next I double clicked on a commit and this commit was checked out (no message or warning).
The previously staged changes are not shown anymore
That last part needs to be verified in command-line, outside of VSCode.
git status
git stash list
If not, as commented by Philippe, git fsck
can somewhat help.
But check first what extension you are using: a double-click on a commit history should not switch to it directly, unless your VSCode+Git Lens also uses the Git Graph extension.
That extension includes issue 39: "On double click - Checkout branch", which seems close to what you have experienced.