The idevicerestore tool allows to restore firmware files to iOS devices.
It is a full reimplementation of all granular steps which are performed during restore of a firmware to a device.
In general, upgrades and downgrades are possible, however subject to availability of SHSH blobs from Apple for signing the firmare files.
To restore a device to some firmware, simply run the following:
$ sudo idevicerestore -l
This will download and restore a device to the latest firmware available.
Development Packages of:
To compile run:
./configure make sudo make install