I have no idea why, but today I did this:
git checkout master
git pull origin master
git checkout myFeature
git merge master
I was merging master
with myFeature
branch so I could solve any conflicts.
To my surprise, no conflicts were shown and it overwrote my files and I lost everything I did on that new feature.
question 1: Why did this happen? Conflicts
weren't supposed to be shown?
question 2: How to revert it properly? I did NOT commit yet.
If I do a git log
it shows all my commits that works (remember, I did NOT commit this merge
yet). I'm not 100% sure if I should reset --hard
to the last commit SHA1. I do not want to keep current changes (which is the merge
) but I'd like to keep everything BEFORE the merge
, which was the last commit.