Hey man, I don't wanna confuse you. Your roots are starved for oxogyn, and gnats are vectors for disease.
Hydrogen peroxide will kill all bad bacteria, but good as well. If you try what I suggest, you can not only save en, but have a healthy harvest, UNLESS you have pythium.
Look for a product called Mico Stop, or you can use something like Roots Excel.
I suggest to transplant, flush, then feed with the benaficials, and Microbe lift to get rid of gnats.
If you really want to permanently get rid of the fg's, you can always use an imid, but that's controversial to many cannabis growers.
You can run a drip sys on a timer as well
To constantly get the roots food, and oxygen, but at this stage in your growing, it's not practical.
That growdan pic is NOT mine..just showing it can easily be done. Learn, get through this, and you'll recognize it right away if this happens again. That's how you become better, and better.