* Reverting a subdirectory of a repo
@ 2011-05-15 13:10 Jay Soffian
0 siblings, 0 replies; only message in thread
From: Jay Soffian @ 2011-05-15 13:10 UTC (permalink / raw)
To: git
Recently I wanted to revert a subdirectory of a repo to an earlier
state, so I did this:
$ git checkout <revision> -- /path/to/subdir
$ git commit
And I was surprised that the subdir retained files that had been added
since <revision>. To get a clean revert, I had to:
$ git rm -r /path/to/subdir
$ git checkout <revision> -- /path/to/subdir
$ git commmit
And I'm wondering if requiring the "rm" first is bug or a feature. On
the one hand, in retrospect I understand why it's needed, but otoh, it
did catch me off guard the first time.
j.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-05-15 13:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-15 13:10 Reverting a subdirectory of a repo Jay Soffian
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).