On Thursday, July 12, 2012 2:35:09 PM UTC+2, miraz wrote:
> Hi,
> entering the command
> git checkout .
> in the root directory of my git repository overwrites all my modified 
> files without any warning.
> Why is there such a dangerous command?

You can't make an omelette without breaking a few eggs :)

Checkout will overwrite any changes in your work-tree unless they are (a) 
changes which have been added to the index (with git add), and (b) 
untracked files.

In essence, checkout is the equivalent of what some other systems call "*
revert*", and you have to get used to treating it with respect (as with any 
git command).

If you want checkout to prompt on every change it overwrites, you can use 
the -p flag.

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to