I don’t know why Avast did that. If it even did. Sounds horrible.
This is not going to help you now, but for everybody else: backup backup backup!
I image my Windows partition once a month. Just as a precaution and to have something to pick files out from if needed. And I keep a rolling 6 months worth of images. The files get stored on my data partition which then gets regularly backed up to an external drive.