I have used another git command than subtree as the following
$ git checkout -b moved_package_branch
$ git filter-branch --index-filter 'git rm --cached -qr -- . && git reset -q $GIT_COMMIT -- src/main/java/com/company/package' --prune-empty
Note that you can include multiple folders (space separated)
Reference: last answer from @David Smiley
Detach many subdirectories into a new, separate Git repository