Subject: Re: untracked file deleted from the master branch, when checked out to it from a local branch

From: Junio C Hamano <[email-masked]>
Date: Tue, 20 May 2014 11:24:11 -0700

Arup Rakshit <[email-masked]> writes:

> On Tuesday, May 20, 2014 12:06:49 PM you wrote:
>
>> 
>> It never "came to the new branch", as it was never version controlled,
>> it was an untracked file left behind when you switched branches.
>> 
>> Once you added it to the new branch, change_class, it became a version
>> controlled file, 
>
> This is still  didn't get it. If an untracked file didn't come in the new 
> branch, how would I able to add it to stage ? I am not getting this part. You 
> are right, but I am not able to understand this one, my bad! :(

Untracked files and modifications to files in your working directory
do not belong to your current branch.  This is to allow you, after
starting to work on one branch then realizing that the changes and
additions you are making do not belong there, to switch to a more
appropriate branch at that point without losing your work so far,
taking these changes and additions with you to the branch you want
to commit your changes to.