Skip to content

Instantly share code, notes, and snippets.

@alexpchin
Created April 27, 2017 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexpchin/a039af9e1eb93e2f1f26872218d937e5 to your computer and use it in GitHub Desktop.
Save alexpchin/a039af9e1eb93e2f1f26872218d937e5 to your computer and use it in GitHub Desktop.
Remove last file from Github
git filter-branch -f --index-filter "git rm -rf --cached --ignore-unmatch FOLDERNAME" -- --all
rm -rf .git/refs/original/
git reflog expire --expire=now --all
git gc --prune=now
git gc --aggressive --prune=now
git push --all --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment