How can I recursively delete all files from my worktree that are tracked by git, leaving only the untracked files? And if the command would also delete then-empty directories...
This is something like an inverse operation to git clean
.
My intention is to keep all untracked files for a data transfer when I can recover the tracked files by cloning the git repository in the target location.