Look into git reflog. If the changes were committed, it was almost certainly possible to still restore them, even if the commit is no longer in your branch.
There are probably other tools like this that keep version history based on filesystem events, independent from the project's git repository
https://www.jetbrains.com/help/idea/local-history.html
There are probably other tools like this that keep version history based on filesystem events, independent from the project's git repository
https://www.jetbrains.com/help/idea/local-history.html