0

I have pushed one of my branch before committing the changes and then checked out to another branch. then I have done git reset to make this branch similar to origin. Also the remote branch has been deleted. Now when I switch back to the first branch, I am not seeing the files which was there. These files has been added , but not committed. How can I restore the files ?

Happy Coder
  • 3,711
  • 10
  • 62
  • 128

1 Answers1

-1

Run the following to show unreachable git objects:

git fsck --cache --no-reflogs --lost-found --unreachable HEAD

To place them in .git/lost-found, skip the --unreachable flag.

Pavel Chernikov
  • 2,027
  • 1
  • 19
  • 35