How to revert on stock firmware?

Hello all! How to revert to stock firmware ??? I used mtd, and i have router linksys wrt1200ac. I wrote wget http://cache-www.belkin.com/support/dl/FW_WRT1200AC_1.0.4.167471_prod.img /tmp and then I wrote mtd -r write /tmp/FW_WRT1200AC_1.0.4.167471_prod.img firmware, and i get error - root@lede:/tmp# mtd -r write FW_WRT1200AC_1.0.4.167471_prod.img firmware
Could not open mtd device: firmware
Can't open device for writing!
help please! Sorry, I'm Russian

Try again with this command : mtd -e linux -r write openwrt-mvebu-armada-385-linksys-caiman-squashfs-factory.img linux

The same result

If you have only flashed once you can just go back to the other partition with this. Using:
sysupgrade -n fw
should also work, but with recent LEDE you may have to add --force

Your command into flash still wrong...

mtd -e linux -r write FW_WRT1200AC_1.0.4.167471_prod.img linux

-e : to erase
-r : to reboot after write your firmware

No ( I flashed him more than once

What's wrong?

I think the device name is wrong.
On command line I get:

root@N0A-0:~# mtd
Usage: mtd [<options> ...] <command> [<arguments> ...] <device>[:<device>...]

The device is in the format of mtdX (eg: mtd4) or its label.
...

Try looking into /dev with ls -l /dev/mtd*.

According to the OpenWrt Wiki the WRT1200AC has two firmware partitions. They are called "kernel1" and "kernel2".

Ok, where to see the device name?

Oh, I entered the command mtd -e kernel1 -r write FW_WRT1200AC_1.0.4.167471_prod.img kernel2 and now I kind of bricks

Just guessing: You erased the kernel1 partition, and installed the new firmware in the kernel2 partition, while the router still tries to boot the (now erased) kernel1 partition.

To change the partition, which the router uses for boot, check Firmware Recovery on the OpenWRT wiki.

Huge enormous thank you !!! And it turns out you can put two and firmware in a way to switch between them?

But how to understand in what the kernel is running the router at the moment?

Here is a description, and a way