Git rm would do the trick. Besides that switching to a branch that never
had them folders would also do the same thing.

git rm -- removes files/folders
git branch -- lists your current branch
git checkout branch -- switches to a new branch and if that new branch
didn't have the folders, then they disappear from your fill system and
return after you switch back to the original branch.
IF you typed this line incorrect: git filter-branch --tree-filter 'rm -rf
databases/' HEAD if would remove all the files in the databases folder from
HEAD this line also looks like it might "filter-branch" looking at
gitignore and removing anything that is in there. (I am only guessing at
this last one because I have never used filter-branch --tree-filter etc...

On Sun, Dec 25, 2011 at 3:00 AM, chandrakant kumar <[email protected]>wrote:

>
>
> On Sun, Dec 25, 2011 at 4:21 PM, lyn2py <[email protected]> wrote:
>
>> I was playing around with some Git commands and accidentally deleted
>> the folders on my local machine that were set to "untrack" in
>> my .gitignore (is this coincidental?)
>>
>> I didn't realize they got deleted until after the entire session of
>> trying out Git commands.
>>
>> I have been trying to retrace my steps to figure out which commands or
>> actions caused me to lose my folders, but to no avail. It's been
>> bugging me for a while so...  it would be great if any Git users can
>> point out what commands may have caused my local folders to get
>> deleted. They didn't even appear in the trash can... I have no idea
>> how it happened.
>>
>> I went through the commands I used during the period, and they were
>> (some commands were typed many times over):
>> git init
>> git commit -m "some message"
>> git push
>> git push origin master
>> git push -u origin master
>> git add .
>> git filter-branch --tree-filter 'rm -rf databases/' HEAD
>> git rebase -i HEAD~2
>> git reset --hard HEAD
>> git push origin master --force
>> git log
>>  git status
>>
> That is why i gave up trying to learn git and moved to mercurial.
>



-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com

Reply via email to