[rules-dev] another standard CM operation: howto in git?

Geoffrey De Smet ge0ffrey.spam at gmail.com
Tue Dec 28 03:01:19 EST 2010


First do "git status" so you get a list of things you might want to 
rollback.
(if you got git colors enabled it looks nicer btw, see emmanual's git 
blog on in.relation.to)

Then just do
git checkout -- theFileIWantToRollback.txt

More info in the the Pro Git book
   http://progit.org/book/ch2-8.html
section Unmodifying a Modified File

> You should also realize that this is a dangerous command: any changes 
> you made to that file are gone --- you just copied another file over 
> it. Don't ever use this command unless you absolutely know that you 
> don't want the file. If you just need to get it out of the way, we'll 
> go over stashing and branching in the next chapter; these are 
> generally better ways to go.

Also after working with git a week or 2 on the command line, so we 
understand git,
we can start looking at the GUI integration (Eclipse EGit, IntelliJ).
In the GUI you get a revert/rollback dialog where you can chose which 
files more easily.

Op 27-12-10 17:54, Wolfgang Laun schreef:
> After some useful and not so useful changes: how can I revert the 
> doodles to their original state without throwing away the useful work?
>
> I've found:
>
>    git checkout -f whatever
>
> which is supposed to "throw away local changes", but how can I 
> restrict this? Or do I have to save everything, reset everything, and 
> copy the goodies back in?
>
> Any better way?
>
> -W
>
>
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev

-- 
With kind regards,
Geoffrey De Smet

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20101228/3b86791c/attachment.html 


More information about the rules-dev mailing list