You can successfully bring a cause of action against the dealership for breach of contract
(as well as possibly fraud) for failing to disclose to you that the car had been declared a total loss, and instead misinforming you that the car had no damage.
Unfortunately, since you have driven the car for two years, you would only be entitled to receive the difference in value between the car being without any damage and having been declared a total loss. However, that is likely a substantial amount since you are unable to trade the car in as a result of their misrepresentation and failure to disclose that the car had been declared a total loss.
As I mentioned above, it's highly unlikely that the dealership would refund the full purchase price of the car, but you may be able to obtain a settlement from them without having to go to court if you want to try to negotiate with them first.
Otherwise, if your damages (difference between the car having been declared a total loss and having no prior damage) are less than $5,000 you can sue in small claims
The information here would be of great assistance to you in doing so:
If you want to claim more than $5,000, you'd have to file in regular civil court.
I hope the above information is helpful.
Please let me know if you have any clarifying or follow up questions as I want to ensure that you are completely satisfied with my service. Please contact me first if you are contemplating leaving me a negative rating, as I’ll be happy to continue to address your concerns until you are completely satisfied with my service.
If not, please remember to rate my answer positively so I get credit for my work. Please also rate me highly (9-10) when you receive your customer satisfaction survey as well.
Thanks and best of luck!