I'm using git bash and I needed to check out some previous commits to see if a bug was in those commits (I only have a single branch). I had some uncommitted changes I was working on and I checked out my latest commit using git checkout <commit id>
. I then returned from detached head state by using git checkout master
, however the uncommitted changes were gone.
First of all I thought git prevented you from checking out a previous commit if you had uncommitted changes? Secondly, are those uncommitted changes I made lost?