The simplest solution is to leave the history alone: Just git mv
all your files into a subdirectory, commit that change, and carry on with your life.
If you really want to pretend as if you did this work in a subdirectory all along, the least complicated way is to use something like:
git filter-branch --tree-filter "mkdir SUBDIR && bash -c 'git mv -k {,.[!.],..[!.]}* SUBDIR/'"
Replace SUBDIR with the name of the target subdirectory.