Error FATAL: database files are incompatible with server.

DETAIL: The data directory was initialized by PostgreSQL version 11, which is not compatible with this version 12.4.

Solution

$ brew postgresql-upgrade-database
$ brew services restart postgresql