The One who is forced to renounce Islam will be forgiven if He does Righteous Deeds afterwards
Allah says:
ثُمَّ إِنَّ رَبَّكَ لِلَّذِينَ هَاجَرُواْ مِن بَعْدِ مَا فُتِنُواْ ثُمَّ جَاهَدُواْ وَصَبَرُواْ إِنَّ رَبَّكَ مِن بَعْدِهَا لَغَفُورٌ رَّحِيمٌ
Then, verily, your Lord for those who emigrated after they were put to trials and then performed Jihad, and were patient, - after this, your Lord is indeed Forgiving, Most Merciful.
This refers to another group of people who were oppressed in Makkah and whose position with their own people was weak, so they went along with them when they were tried by them. Then they managed to escape by emigrating, leaving their homeland, families and wealth behind, seeking the pleasure and forgiveness of Allah. They joined the believers and fought with them against the disbelievers, bearing hardship with patience.
Allah tells them that after this, meaning after their giving in when put to the test, He will forgive them and show mercy to them when they are resurrected.
صبر و استقامت
یہ دوسری قسم کے لوگ ہیں جو بوجہ اپنی کمزوری اور مسکینی کے مشرکین کے ظلم کے شکار تھے اور ہر وقت ستائے جاتے تھے آخر انہوں نے ہجرت کی ۔ مال ، اولاد ، ملک ، وطن چھوڑ کر اللہ کی راہ میں چل کھڑے ہوئے اور مسلمانوں کی جماعت میں مل کر پھر جہاد کے لئے نکل پڑے اور صبر و استقامت سے اللہ کے کلمے کی بلندی میں مشغول ہو گئے ، انہیں اللہ تعالیٰ ان کاموں یعنی قبولیت فتنہ کے بعد بھی بخشنے والا اور ان پر مہربانیاں کرنے والا ہے ۔ روز قیامت ہر شخص اپنی نجات کی فکر میں لگا ہو گا ، کوئی نہ ہو گا جو اپنی ماں یا باپ یا بھائی یا بیوی کی طرف سے کچھ کہہ سن سکے اس دن ہر شخص کو اس کے اعمال کا پورا پورا بدلہ ملے گا ۔ کسی پر کوئی ظلم نہ ہو گا ۔ نہ ثواب گھٹے نہ گناہ بڑھے ۔ اللہ ظلم سے پاک ہے ۔