'sudo rmdir'? I don't think that does what they think it does.
So that example should have been:
cd ..
mv fucking-git-repo-dir fucking-git-repo-dir.archived.$(date +%s)
git clone https://some.github.url/fucking-git-repo-dir.git git fetch origin master && git reset --hard origin/master
imo sudo rm -rf /some/path --no-preserve-root