deleted postgres files on ubuntu
That depends on what you deleted: was it the database data or the database software?
Since psql still works, I suspect that the database software is still there, and you deleted the data. Then the only way to recover is to restore from a backup.
No, there is no way to &quot;undelete&quot; data.