On Tuesday, June 3, 2014 9:08:02 AM UTC+2, Philip Oakley wrote:
> ----- Original Message ----- 
> *From:* André Hänsel <javascript:> 
> *To:* git-...@googlegroups.com <javascript:> 
> *Sent:* Monday, June 02, 2014 7:48 AM
> *Subject:* [git-users] git reset with staged changes
> I just learned painfully that git reset --hard deletes any previously 
> untracked files that have been staged. I had to recover them one by one 
> using git fsck. 
> Before I did the reset I actually checked the list of files and saw them 
> but I assumed that after the reset those files would be unstaged and 
> untracked again. It just seemed the most natural bahavior.
> Is this a missing feature or is it in fact more logical to delete them?
> An alternative question would be, "Could the man page be improved so that 
> what you ned was spotted sooner?". 
> I ask because a similar discussion is happening on the developers list? 
> (Aside: what reference material do you normally check in these cases?)
> Philip

I had merged a feature branch into master to see the result and noticed 
that a prerequisite in master was missing (a database migration), so I 
added and staged it. I wanted to have it in master before the merge, so I 
was going to undo the merge by resetting. As usual I made sure that I had 
no uncommited changes. There were only a few untracked files laying around 
and my untracked (so I thought) but staged file, so I felt safe to reset. I 
was expecting to see my migration file as untracked afterwards, ready to be 
staged again.

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to