I made some changes to file a.py and created two new files b.py and c.py and then committed the changes, but got a warning:
The Git repository at the following path is in the detached HEAD state
I ignored it and committed the changes anyway. Let's refer to this commit as commit X.
Then I did a checkout and boom, the a.py and b.py files disappeared and so did the changes I made to a.py. Now commit X doesn't show in the list of commits.
I only had a master branch, so this is not because I am in a different branch.
I don't understand Git and I am using the graphical interface of PyCharm. How can I get back the files?