Cannot open generated.h file

Create a new class derived from UObject or some child class (Actor is one of them) then copy your code from the old .h file to the new .h file and from the old .cpp file to the new.cpp file.

To delete the old class, follow these instructions:

How to delete a C++ class