I think I just totally messed up.
I\'ve been working on a project for 2 days and I was trying Magit in emacs to commit the project but I kept getting back to the sta
First of all make a backup of the whole folder to start with.
Secondary : Yes you can if you have committed your files?
git add
them?If you did ill explain how you can find them and get them back,
if you did not at least add them to the index then you lost them.
Update me and ill update my answer accordingly.
The trick is to checkout the previous commit of the last good commit (this should be your revert commit in your question)
Then checkout the version at the commit before, using the caret (^) symbol:
git checkout <last good commit>^
The trick is the ^
which stands for the previous commit
I also did the git add and they were in the staging area ready to commit, but I've never passed the commit part.
Here is a sample on how to lose my file
So you are saved (but still you have some work in front of you.)
git fsck --full
Execute git fsck --full
and then loop over the files are check to see which one is yours using the git cat-file -p <SHA>
As you can see in the sample image i managed to recover my un-commitd file b.txt