Flashing Firmware Samsung Galaxy S 2 GT i9100

Do it at your own risk!!! Read complete guide once and then apply , if you skip any step then it can cause of bricked phone.
Follow this Guide on your risk and if your device gets damaged or bricked during the process, I am not responsible. Please follow steps carefully

If ready then let’s get do it :
1. Go to Settings – Applications – Development and enable usb debugging
2. If you have rooted phone or using any custom ROM then you will have to clear cache and wipe data which can done by booting your phone in recovery mode and select Wipe data/factory reset and also select wipe cache partition
3. Download ODIN3 V1.83 ( I used v.1.85 and its fine) – it is a tool that is used to flash firmware on your phone
Drivers – Download and install drivers that are required to detect your phone by pc
Download Firmware for your phone from http://www.Samfirmware.com
Download .PIT File
4. Installing Firmware
If you have KIES installed skip next step
Extract SAMSUNG_USB.rar and install drivers on pc
Extract Firmware files on safe place, you will get some .tar file so please don’t extract .tar files [Password= samfirmware.com]
Run Odin3 v1.83.exe by right click and select run as admin

After extracting Firmware – VERY IMPORTANT

* If you got three or more files then Select Re-Partition , Auto Reboot and F.Reset Time

* If you got only single file then select Auto Reboot and F.Reset Time

Select .tar files from firmware folder,

* If you got three or more files then
Click on PIT and Select .pit file
Click on PDA and Select .tar file with CODE / PDA in the name
Click on PHONE and Select .tar file with MODEM in the name
Click on CSC and Select .tar file csc / csc-multi in the name
(See Image below carefully to understand which files to select)

* If you got only single files , then

Click on PDA and select single .tar file

Switch off your phone
Now boot it in download mode (press & hold volume down and middle key and while holding both press power on key)

When entered in download mode connect your phone to pc with usb cable
You will see ID:COM section turn yellow and in message boxes “ADDED” appears, that means your phone is ready to start flashing process

Now Click on “START” Button

Do not disconnect the cable or turn off the device, it will reboot when it finishes.
Congratulations you have successfully installed firmware on your Samsung Galaxy S 2, Now last step left is clearing cache data.
Boot your phone in recovery mode (press and hold VOLUME UP and MIDDLE KEY ,while holding both press POWER ON)
In recovery mode touch screen will not work so use volume UP and Down navigate through options and MIDDLE KEY to confirm
choose “wipe cache partition” from menu
it will clear the cache data
now select reboot system now

(Big thanks to Kuldeep singh for this tutorial and as always XDA-DEVELOPERS.COM