How to delete all magento 2 order, invoice, shipment, and credit memo, and reset the increment_id too using php code?
Create Magento Module.
or Create php file in that create queries and execute using ajax button placed in admin of magento.
First find out all tables being impacted then you can easily know the SQL queries .
Try using "ALTER TABLE table_name AUTO_INCREMENT = 1;" sql query to reset auto-increment.