For the test I will restore the firmware of the D-Link DES-3200 switch.
1) Download the firmware on the official website, I left the link in this article – Firmware Update for D-Link DES-3200 Switch
2) Turn off the power of the switch, connect it with a console (RS-232) cable to a computer with the Linux operating system, run Minicom, set the connection settings by pressing the Ctrl+A O keys, for example for the DES-3200 the flow rate is 9600, without flow control and 8N1. The port is usually ttyS0, if via USB adapter, then ttyUSB0.
See also my article – Installing and Using Minicom
Or use ExtraPutty on Windows.
3) We turn on the switch, right after switching on, when “Power On Self Test” is displayed, press two SHIFT+3 keys simultaneously.
4) The window that will open should display:
Image Option: [Create]
Download Protocol: [zModem]
Baud Rate: 
If necessary, put the space required by the key as shown above, move the arrows down on the keyboard by selecting “Apply” and press the Enter key.
After that, you need to change the connection speed to 115200, press Ctrl+A O to go to the Minicom settings and set the speed, exit the settings by pressing the Esc key.
5) Press the Ctrl+A S keys to open the file sending window, select zmodem, find the firmware file on the disk, mark the space bar and press Enter, then the file transfer will begin.
At the end of file transfer, we will return the speed to 9600, when the following message appears:
Please change your baud rate to 9600 for normal operation !!
6) If the switch does not start from the downloaded firmware, then you need to specify that it is bootable (up to two firmware can exist in the switch).
Similarly, when you turn on the switch, press the SHIFT+3 keys and, for example, set:
Image Option: [Set_Boot]
Select Image: 
After that, select “Apply”, press the Enter key, select “Reboot” and press the Enter key to reboot the switch.
The configuration after the restoration of the firmware will remain the same.
Watch the video as I did: