Today at work, one of my colleagues noticed that doing a git stash while providing the file path removes the untracked files.
git stash -- src/
This was in fact a bug, fixed in commit bba067d2faf047597bc76f885fb0cf87894b5ed1 by Thomas Gummerer. This means you need Git v2.16.2 or later to have the fix. The bug was introduced in commit df6bba0937209d679a06affffd26975593fef744f2, which means Git v2.13.0 or later.
(To avoid the bug, don't stash by pathspec. The stash-by-pathspec feature was new in Git v2.13.0, in the very same commit that has the bug.)