We assume that there are two users (A and B). A is gonna delete the bad files. B is gonna receive the changes.
At the start, we need A and B to have the SAME version history.
We'll assume there are no branches other than master.
git filter-branch --force --index-filter
'git rm --cached --ignore-unmatch relative/path/to/bad_file.txt'
--prune-empty --tag-name-filter cat -- --all
Source: https://stackoverflow.com/questions/2004024/how-to-permanently-delete-a-file-stored-in-git
git push --force --all
git fetch
git status
Expected output: Message showing origin/master has diverged.
On branch master
Your branch and 'origin/master' have diverged,
and have 3 and 1 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
nothing to commit, working tree clean
git reset --hard origin/master