I've rinsed soil from a root system then re-planted. High chance you shock the plant, but it should recover. However, with an autoflower it may not be a good option. You'd have to hope it delays flower or it'll pretty much ruin your outcome with a very small yield relative to time invested (already a risk if you have a bunch of larva chomping on the roots).
Bti is an option, along with some stiky traps. Bti will kill the larva. It'll take 2-3 weeks to control a dumpster fire of gnats. Bti can also be used pre-emptively. Gnats usually come in with the soil you buy, unless this is outside. Obviously outside, is different in this regard, but it's really hard to get gnats indoors without them traveling in with the soil that is used.
Anyway, mosquito bits and dunks (for reservoirs) are great to use from the start of a grow to eliminate the concern of gants and anything else that lays larva in the substrate. brand may be different in other regions of the world, but it is always "Bti". It's a microbe. It's been used on our food crops for over 100 years, if notmistaken. it is safe.
Now, it is an autoflower, so it's possible the stress causes it to flower faster. It's also possible this stress delays flower too... cross your fingers for the latter to be true.
extra info - adults (the ones flying around) don't damage the plants. they are just annoying and reproducing. so, sticky traps kill from other end of life cycle, so there's definitely a benefit from doing both together. however, traps are not effective on their own. Bti can be effective on its own by comparison.