Intention matters. Our beloved Creator, The Most High ( All praise is due to him, The Most Benevolent, The Most Compassionate) knows what was in your heart and he knows the intent. Certainly The Oft-Forgiving, The Ever-Present, The Most Great will take everything into consideration. The circumstance has now become that you do know better now, and will be expected to follow the correct way that you learned. But do be sincere. Be sincere in your repentance for this and be sincere in your striving to do better. I hope this is helpful to you.
عَنْ أَنَسٍ رَضِيَ اللهُ عَنْهُ ، قَالَ : سَمِعْتُ رَسُولَ اللهِ صَلَّى الله عَلَيْهِ وَ سَلَّمَ ، يَقُولُ :
قَالَ اللهُ تَعَالَى : يَا ابْنَ ادَمَ ، إِنَّكَ مَا دَعَوْتََنِي وَرَجَوْتَنِي ، غَفَرْتُ لَكَ عَلَى مَا كَانَ مِنْكَ وَلَا أُبالِي . يا ابْنَ ادَمَ :لَوْ بَلَغَتْ ذُنُوبُكَ عَنانَ السَّماءِ ثُم َّ اسْتَغْفَرْتَني ، غَفَرْتُ لَكَ . يَا ابْنَ ادَمَ : إِنَّكَ لَوْ أَتَيْتَنِي بِقُرَابِ الأَرْضِ خَطَايا ثُمَّ لَقِيتَني لَا تُشْرِكُ بِي شَيْأً ، لَأَتيْتُكَ بِقُرَابِها مَغْفِرَةً
رواهُ الترمذي (وكذلك أحمد) وسنده حسن
On the authority of Anas (may Allah be pleased with him), who said:
I heard the Messenger of Allah (ﷺ) say: Allah the Almighty said:
O son of Adam, so long as you call upon Me and ask of Me, I shall forgive you for what you have done, and I shall not mind. O son of Adam, were your sins to reach the clouds of the sky and were you then to ask forgiveness of Me, I would forgive you. O son of Adam, were you to come to Me with sins nearly as great as the earth and were you then to face Me, ascribing no partner to Me, I would bring you forgiveness nearly as great as it.
It was related by at-Tirmidhi (also by Ahmad ibn Hanbal). Its chain of authorities is sound.
40 Hadith Qudsi
(40 Hadith Qudsi)
Arabic/English book reference : Hadith 34
عَنْ ابْنِ عَبَّاسٍ رَضِيَ اللَّهُ عَنْهُمَا، عَنْ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ، فِيمَا يَرْوِي عَنْ رَبِّهِ عَزَّ وَجَلَّ، قَالَ:
"إِنَّ اللَّهَ كَتَبَ الْحَسَنَاتِ وَالسَّيِّئَاتِ، ثُمَّ بَيَّنَ ذَلِكَ: فَمَنْ هَمَّ بِحَسَنَةٍ فَلَمْ يَعْمَلْهَا، كَتَبَهَا اللَّهُ لَهُ عِنْدَهُ حَسَنَةً كَامِلَةً، فَإِنْ هُوَ هَمَّ بِهَا فَعَمِلَهَا، كَتَبَهَا اللَّهُ لَهُ عِنْدَهُ عَشْرَ حَسَنَاتٍ، إِلَى سَبْعِمِائَةِ ضِعْفٍ، إِلَى أَضْعَافٍ كَثِيرَةٍ، وَمَنْ هَمَّ بِسَيِّئَةٍ فَلَمْ يَعْمَلْهَا، كَتَبَهَا اللَّهُ لَهُ عِنْدَهُ حَسَنَةً كَامِلَةً، فَإِنْ هُوَ هَمَّ بِهَا فَعَمِلَهَا، كَتَبَهَا اللَّهُ سَيِّئَةً وَاحِدَةً"
.
رواه البخاري ومسلم
On the authority of son of Abbas (may Allah be pleased with them both), from the Messenger of Allah (ﷺ), among the sayings he related from his Lord (glorified and exalted be He) is that He said:
Allah has written down the good deeds and the bad ones. Then He explained it [by saying that] he who has intended a good deed and has not done it, Allah writes it down with Himself as a full good deed, but if he has intended it and has done it, Allah writes it down with Himself as from ten good deeds to seven hundred times, or many times over. But if he has intended a bad deed and has not done it, Allah writes it down with Himself as a full good deed, but if he has intended it and has done it, Allah writes it down as one bad deed.
It was related by al-Bukhari and Muslim.
40 Hadith Qudsi
(40 Hadith Qudsi)
Arabic/English book reference : Hadith 16
عَنْ أَبِي هُرَيْرَةَ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ:
" لَمَّا قَضَى اللَّهُ الْخَلْقَ، كَتَبَ فِي كِتَابِهِ عَلَى نَفْسِهِ، فَهُوَ مَوْضُوعٌ عِنْدَهُ: إِنَّ رَحْمَتِي تَغْلِبُ غَضَبِي"
رواه مسلم (وكذلك البخاري والنسائي وابن ماجه)
On the authority of Abu Hurayrah (may Allah be pleased with him), who said that the Messenger of Allah (ﷺ) said:
When Allah decreed the Creation He pledged Himself by writing in His book which is laid down with Him: My mercy prevails over my wrath. It was related by Muslim (also by al-Bukhari, an-Nasa'i and Ibn Majah).
40 Hadith Qudsi
(40 Hadith Qudsi)
Arabic/English book reference : Hadith 1
عَنْ أَبي هُرَيْرَةَ ، رَضِيَ اللهُ عَنْهُ ، عَنِ النَّبَيِّ صَلَّى الله عَلَيْهِ وَ سَلَّمَ ، فِيما يَحْكِي عَنْ رَبِّهِ عَزَّ وَجَلَّ ، قَالَ :
أَذْنَبَ عَبْدٌ ذَنْبًا ، فَقَالَ : اللَّهُمَّ اغْفِرْ لِي ذَنْبي . فَقَالَ تَبَارَكَ وَتَعَالى : أَذْنَبَ عَبْدِي ذَنْبًا ، فَعَلِمَ أنَّ لَهُ رَبّاً ، يَغْفِرُ الذَّنْبَ ، وَيَأْخُذُ بِهِ . ثُمَّ عَادَ فَأَذْنَبَ ، فَقَالَ : أَيّ رَبِّ ، اغْفِرْ لِي ذَنْبِِي ، فَقَالَ تَبَارَكَ وتَعَالى : عَبْدِي أَذْنَبَ ذَنْباً . فَعَلِمَ أَنَّ لَهُ رَبّاً يَغْفِرُ الذَّنْبَ ، ويَأْخُذُ بِهِ . ثُمَّ عَادَ فَأَذْنَبَ ، فَقَالَ : أَيّ رَبِّ ، اغْفِرْ لِي ذَنْبِي : فَقَالَ تَبَارَكَ وَتَعَالَى : أَذْنَبَ عَبْدِي ذَنْباً ، فَعَلِمَ أَنَّ لَهُ رَبّاً ، يَغْفِرُ الذَّنْبَ ، ويَأْخُذُ بالذَّنْبِ . اعْمَلْ مَا شِئْتَ ، فَقَدْ غَفَرْتُ لَكَ .
رواهُ مسلم (وكذلك البخاري)
On the authority of Abu Hurayrah (may Allah be pleased with him) that the Prophet (ﷺ), from among the things he reports from his Lord (mighty and sublime be He), is that he said:
A servant [of Allah's] committed a sin and said: O Allah, forgive me my sin. And He (glorified and exalted be He) said: My servant has committed a sin and has known that he has a Lord who forgives sins and punishes for them.
Then he sinned again and said: O Lord, forgive me my sin. And He (glorified and exalted be He) said: My servant has committed a sin and has known that he has a Lord who forgives sins and punishes for them.
Then he sinned again and said: O Lord, forgive me my sin. And He (glorified and exalted be He) said: My servant has committed a sin and has known that he has a Lord who forgives sins and punishes for sins. Do what you wish, for I have forgiven you
.
It was related by Muslim (also by al-Bukhari).
40 Hadith Qudsi
(40 Hadith Qudsi)
Arabic/English book reference : Hadith 33
عَنْ جُنْدُبٍ رَضِيَ اللهُ عَنْهُ : أَنَّ رَسُولَ اللهِ صَلَّى الله عَلَيْهِ وَ سَلَّمَ حَدَّثَ
(أَنْ رجُلاً قال : واللهِ لا يَغْفِرُ اللهُ لِفُلانٍ وإِنَّ اللهَ تَعَالَى قَالَ : مَنْ ذَا الَّذِي يَتَأَلَّى عَلَيَّ أَنْ لا أَغْفِرَ لِفُلان،فَإِنِّي قَدْ غَفَرْتُ لِفُلانٍ، وأَحْبَطْتُ عَمَلَكَ (أَوْ كَمَا قَال
رواه مسلم
On the authority of Jundub (may Allah be pleased with him), who said that the Messenger of Allah (ﷺ) related:
A man said: By Allah, Allah will not forgive So-and-so. At this Allah the Almighty said: Who is he who swears by Me that I will not forgive So-and-so? Verily I have forgiven So-and-so and have nullified your [own good] deeds (1) (or as he said [it]).
(1) A similar Hadith, which is given by Abu Dawud, indicates that the person referred to was a goldly man whose previous good deeds were brought to nought through presuming to declare that Allah would not forgive someone's bad deeds.
It was related by Muslim.
40 Hadith Qudsi
(40 Hadith Qudsi)
Arabic/English book reference : Hadith 31