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

Just to clarify, I did not use the following commands at all:
git checkout
git pull
git clone

I have also deleted the .git folder and performed git init again at
least once, just in case this action is key to figuring out how in the
world I managed to delete my local folders...

I will also appreciate if any Git users can point out how to prevent
future accidental deletions on my local machine (I will want to keep
all the folders, databases, uploads, cache etc on local machine, but
only keep the code base on version control). I thought Git doesn't
touch my local folders as long as I'm just "pushing" to the repo!

Thanks and Happy Holidays!

Reply via email to