Re: git-checkout silently throws away the dirty status of index without a warning?
- From
Andrew Ardill <andrew.ardill@gmail.com>
- Date
- Sep 2, 2011, 01:52 UTC
- Message-ID
- <CAH5451mU1DOb3T27U4kYCFzhSVRzmP6Z94h+5oq-K5CU71gTBg@mail.gmail.com>
- In-Reply-To
- <CAEvN+1hA1mUjDc0cQidEBOf5LhJ9LrVbTjyV5qPkUKNM6f7urQ@mail.gmail.com>
> I accidentally switch to the switched-to branch without committing the > intermediate status. > The 'work' was gone, and I had no idea how to bring it back.
Forgive me if I am missing something here, but can't you use reflog to go back to the point just before you checked the switched-to branch out?
I guess the question is in general, how do you revert to a previous instance of the working index AND previous checked out branch? I don't know the 'switch branch with modified working index' mapping well enough to be able to determine if there is a bijection possible, a concise description of it would probably show us. If not, the only way to achieve this is to keep the history available.
Regards,
Andrew Ardill