I would try the restore options first. You can find instructions for the restore menu here

If the recovery menu doesn’t work put the Mac mini in DFU mode by following the instructions I have here

One the device is in DFU open Apple Configurator 2 (Mac Only sorry Windows folks). Make sure you are at least at version Version 2.13.2

Connect the USB-C cable to the Mac and the Mac mini to the port closest to the ethernet port

Connect the USB-C cable to the port marked with a lightning bolt.

If you are presented with the DFU screen below in Apple Configurator 2 the procedure was done correctly

The image shows the DFU screen in Apple Configurator 2, indicating a successful full restore of the Mac mini M1.

Right click -> Advanced -> Revive device

The image shows a Mac menu with “Advanced” selected, leading to options like “Revive Device” for a full restore.

This will download the operating system and perform a reinstall of the OS preserving the user data

If you would like to erase everything pick the restore option

The image shows a menu with options for managing backups and restoring data on a Mac.

Apple Configurator 2 will go through downloading the firmware and perform a restore of the system

The image shows Step 4 of 4: Installing System during a Mac mini M1 restore using Apple Configurator 2.