Additional SQL Server features and topics not covered by specific categories
In addition to other posts:
If you want to revert to SQL 2012, you uninstall SQL 2017, install SQL 2012, apply service packs. You would then have to restore backups taken with SQL 2012 - I hope you took backups before the upgrade!
You cannot restore backups from SQL 2017, nor can you cannot attach the database files to SQL 2012.