I am a beginner with Git and I am learning by using it for a project.
I use GitHub Desktop for Mac.
I recently committed some changes of my project, but I wanted to revert the commit with the purpose of removing the virtual commit but not the real files (so I would edit the project and generate a new commit).
So, I clicked the Undo button and I deleted the latest commit, but also all my files.
The file loss is big, but I mentally went through it in order to resolve the problem of my project in a better way.
The purpose of this post is: why the Undo removed also all my files? Is because I reverted to an old version of my project (to an old commit)? If so, how can I remove a virtual commit without deleting all my progress?
Probably I’ll switch directly to the console commands in order to have full control on my repo.
Thanks in advance!