git rm -r .
git checkout HEAD~3 .
git commit
After the commit, files in the new HEAD will be the same as they were in the revision HEAD~3.
git rm -r .
git checkout HEAD~3 .
git commit
After the commit, files in the new HEAD will be the same as they were in the revision HEAD~3.