NishiJain
NishiJain

Reputation: 121

Accidentally removed gitignored folders

I have accidentally deleted gitignored folders by running command git clean -fdx. I have not yet pushed any changes.

Is there a way by which I can restore gitignored folders ?

Upvotes: 0

Views: 47

Answers (1)

anothernode
anothernode

Reputation: 5397

If git is told to ignore those directory, by definition they are not tracked in the git repository. So, I'm afraid, as far as I can see, there's nothing git could do to restore those directories.

Your only chance would be some separate backup mechanism like Time Machine on macOS or some other means of data recovery. Usually when you delete a file, actually only some entry in an address table of the file system gets deleted, while the actual data is still physically there until the respective data blocks get overwritten with some other data. Data recovery tools make use of this fact to restore deleted data. But this would obviously be a matter completely unrelated to git.

Upvotes: 4

Related Questions