The process of recovering your IMEI on Samsung Galaxy SII involves, backing up .nv_data file and restoring the one which comes with the stock firmware.You can do this manually using the method posted by vaskodogamagmail which can be found here.
If you do not wish to do it manually, you can use this simple application by Helroz.
GSII_repair is an app which lets you recover your IMEI on your Samsung Galaxy S2 easily.
You can install this application from Google Play from the link given at the end of the post. Open the app and select Save actual EFS folder. You can also backup your current EFS folder using this app.