Oh boy. I see what you did, and it's not pretty. Let's read the documentation for "git clean":
git-clean - Remove untracked files from the working tree
This means that git-clean
deletes files that it cannot restore. Git has some safety measures in place so that you don't accidentally run git clean
-- it won't delete directories unless you specify -d
, won't delete ignored files unless you pass -x
, and won't do anything at all unless you specify -f
.
It looks like you turned your home directory into a Git repository, committed the *.c
files, and then deleted everything else.
It's basically like running rm -rf *
, or del /s *.*
in Windows. Don't do that.
Solution
Restore from backup.
If you don't have a backup, then this is a painful object lesson in why we have backups, and you will have to try to recover the deleted files -- and you must turn off your computer and not boot into Windows until this is complete.
Note on "untracked files"
An "untracked file" is a file that is not part of your Git repository. I can see how if you think that untracked files are part of your Git repo, you will try increasingly dangerous things until they are deleted. The untracked files were never part of your Git repo to begin with, so there was nothing you needed to do to remove them from your Git repo.
Note on -f
The -f
/ --force
option means "this command will delete data, and I know what I'm doing." Before you type -f
at any command prompt you should reflect for a moment to think about what data this command will delete and make sure that you actually want to delete it.
For example, git rm
takes -f
as a parameter. The git rm
command will refuse to delete a file with uncommitted changes, because this will destroy the changes. Using -f
overrides this behavior, allowing you to destroy data with git rm
.