Any files that are no longer part of the application should be removed from developer view, and from the build.
It is usually better to delete or archive the file altogether. Modern version control systems retain a backup of the original file if it needs reviving from the dead.
One creative idea is that if a class must be retained as an example, it can be moved to an obsolete package or to an example package but be careful. Files that are not part of the solution slow down the development process by presenting false positives when real problems are being investigated and by requiring maintenance to keep up to date.