-1

After working on my project and making a few commits, I decided to push and be done for a bit. However, an error occurred somewhere during the process and the project ended up getting severely messed up, with the majority of my changes being eliminated. I tried to reset the project to the latest commit I made using:

git reset --hard b91ca10fdfc96ddd0e2aba09b7861117a6bdc17e

I then got the message that the HEAD had been reset to this commit. However, when I open the project my changes have not returned. The project is Xcode written is Swift. Any help is greatly appreciated, I would really like to avoid rewriting a massive amount of code.

jub0bs
  • 60,866
  • 25
  • 183
  • 186
treyhakanson
  • 4,611
  • 2
  • 16
  • 33

1 Answers1

0

Since I am not aware of your git project status, here's few thought.

  1. Do git log and check what is your last commit. Also do git status to be sure nothing is in working copy
  2. Try git cat-file commit b91ca10fdfc96ddd0e2aba09b7861117a6bdc17e. If it errors out it means that the shah isn't available.
  3. If step 2 results in a commit then, try git checkout b91ca10fdfc96ddd0e2aba09b7861117a6bdc17e. It should switch you to that commit. You can later rename this branch.
Abhijeet Kasurde
  • 3,937
  • 1
  • 24
  • 33
Sanoj
  • 41
  • 1
  • 3