downloaded a qfx file and the whole account got duplicated transacations making a total mess
And why did you have to download a QFX file? Doesn't the normal One Step Update process work for you? More details would be helpful.
To unravel the mess I recommend you restore your Quicken data file from a backup taken just prior to importing the QFX file. https://www.quicken.com/support/how-backup-or-restore-your-quicken-data