If for some reason you need to return your AT&T Galaxy S2 back to the store for warranty or you just itch to get back to a completely stock phone, you can unroot/unbrick your phone using methods outlined here, which will completely unroot your phone with stock ROM.
Step 1. Plug in your microUSB cable to your AT&T Galaxy S2 to your computer. Then hold down Volume Up, Volume Down, and Power button together.
Step 2. When you see the warning sign, hit the Volume Up button to enter Download Mode.
Step 3. Download unrooting files here and unzip, then run odin3 v1.85.exe.
Step 4. Make sure you can see a yellow highlighted COM box. (the number doesn’t matter)
If you don’t see it, you need to install the correct drivers, simply download and install Samsung Kies software. (Download Samsung Kies)
Step 5. Click on “PDA” then choose ATTGalaxyS2Unroot_SGH-i777.tar file in the unzipped folder then hit “Start”. Your unrooting process should begin.
Step 6. Once unrooting has been complete, your phone will reboot.
Step 7. You will see that your AT&T Galaxy S2 has been unrooted to stock 2.3.4 ROM. If your phone gets stuck on boot loop, don’t worry follow Step 8.
Step 8. You will want to do a factory reset your device completely so take the microUSB cable OUT then reboot into stock recovery by holding down Volume Up, Volume Down, and Power button together until you see stock recovery.
Step 9. Once in stock recovery, choose “wipe data/factory reset” and hit Power button.
Step 10. When it’s complete, choose “Reboot system now” and hit Power button to reboot.
Step 11. Your phone should reboot and you will be completely back to stock ROM.
Now, from here you might want to backup your AT&T Galaxy S2’s internal storage if you have any personal files/media there then erase them before you return your phone.
That’s about it, you can unroot your AT&T Galaxy S2 SGH-i777 model any time back to stock Android 2.3.4. You can always upgrade to future version after unrooting using its system update feature.