Switched Branch After .gitignore and lost .gitinored files
You can do this by using git reflog --all
to get the SHA code from when the Github App automatically stashed your ignored files before switching to the other branch. See https://stackoverflow.com/a/8865242/2970321.
For example, I fetched a pull request (/pr/364
) using the app (SHA 2ba129d
). Before I switched back to gh-pages
, it stashed my ignored files (SHA 36edfc6
).
So to recover, all I needed to do was:
git checkout 36edfc6
My files magically reappeared, and I was able to safely stash them manually somewhere else before switching back to gh-pages
again.