I might have wasted a lot of time. My commit wasn't working because of some warnings saying something about CLRF to LF.
I was looking for a fix and I did
$ rm .git/index
$ git reset --hard HEAD
Following an answer here, it being in the morning, not fully comprehending what it said I executed the commands and my project reverted to my latest commit (which was a while ago because of the warnings I didn't try to fix as soon as I got them).
I got the Xcode alert saying the project changed and if I wanted to revert it or keep the Xcode version, I clicked to keep the Xcode version. As soon as I looked at my project I saw a lot of files were gone, not to be found in the trashcan.
I'm afraid to touch the project or do anything other answers suggest in case I mess it up even more.
It would be devastating if I can not get the files back, anyone got into a similar situation?