I was on the master branch, and I ran git checkout -b ui
. Did tons of work over the course of a week, at the end of which I ran:
git add .
git commit -am 'ui'
git checkout master
git merge ui
git push
I then switched to a branch that I had worked on previously- git checkout uploads
- At which point every thing I had done in the ui branch was lost. It's not listed in git log
, and git reset --hard HEAD^
takes me back to the branch prior to the 'ui' branch. How does this happen?
I was able to recover most of it by looking through reflog and reverting to the 'ui' commit, but I wonder what causes this to happen?