I have 

> Is there a git porcelain command to revert the working dir state of a 
> staged file to its HEAD state and at the same time keep the staged state of 
> the file? Later I would like to be able to revert the working dir state to 
> the staged state of the file. My initial thought was to use git checkout 
> HEAD -- targetfile, but it resets the staged state of the file too. I see 
> that this is doable with git stash, but it affects other files while I 
> would like to focus on a single file and preserve the state of the others 
> untouched as otherwise it could lead to merge conflicts:
> git add targetfile
> git stash
> ... // modify tagetfile in seeking of different task solution, possibly 
> modifying other files too
> git checkout HEAD -- targetfile //drop the different solution attempt, keep 
> other modified files if any
> git stash apply --index // revert to the stashed staged solution, but 
> produces merge conflict for other modified files
> I found a nice article <http://www.progit.org/blog/2011/07/11/reset.html> 
> with 
> summary table at the end which lacks the scenario described in this 
> question. In my opinion this should be easily feasible, but I am surprised 
> that staged and working dir states are so tightly coupled - you can reset 
> the staged state for a file while preserving its working dir state, but I 
> have hard time to achieve the opposite.
Where should we submit a feature request in case a porcelain command is 
missing for this case?

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/groups/opt_out.

Reply via email to