git remove

git rm file1.txt
git commit -m "remove file1.txt"

But if you want to remove the file only from the Git repository and not remove it from the filesystem, use:
git rm --cached file1.txt
git rm -r --cached folder
git commit -m "remove file1.txt & folder"

https://stackoverflow.com/questions/2047465/how-can-i-delete-a-file-from-a-git-repository

Git init –bare

    1. git init --bareĀ (--bare flag it is generally only used on servers)
    2. create file: project.git/hooks/post-receive/
    3. Write in file: git --work-tree=/var/www/project --git-dir=/var/repo/project.git checkout -f
    4. chmod +x post-receive
    5. create project folder: /var/www/project

git clear working directory

git checkout . - Removes Unstaged Tracked files ONLY [Type 2]

git clean -f - Removes Unstaged UnTracked files ONLY [Type 3]

git reset --hard - Removes Staged Tracked and UnStaged Tracked files ONLY[Type 1, Type 2]

git stash -u - Removes all changes [Type 1, Type 2, Type 3]

Conclusion:

It's clear that we can use either

(1) combination of `git clean -f` and `git reset --hard`
OR

(2) `git stash -u`