Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:2:58

And ˹recall˺ when We said, "Enter this city and eat from it wherever you will in ˹ease and˺ abundance, and enter the gate bowing humbly and say, 'Relieve us of our burdens.' We will ˹then˺ forgive your sins for you, and We will increase the doers of good ˹in goodness and reward˺."  

And when We said, to them, after they came out of the wilderness, ‘Enter this city, either the Holy House ˹of Jerusalem˺ (Bayt al-Maqdis) or Jericho (Arīhā), and eat freely therein wherever you will, plentifully and without any restrictions, and enter it at the gate, its gate, prostrating, bowing, and say, ‘our request is for ˹an˺ exoneration’, that is, ‘That we be exonerated from our transgressions’, and We shall forgive (naghfir: a variant reading has one of the two passive forms yughfar or tughfar, ‘˹they˺ will be forgiven’) you your transgressions and We shall give more to those who are virtuous’ — through obedience — in terms of reward.
القرآن:٢:٥٨

وَإِذْ قُلْنَا ادْخُلُوا هَٰذِهِ الْقَرْيَةَ فَكُلُوا مِنْهَا حَيْثُ شِئْتُمْ رَغَدًا وَادْخُلُوا الْبَابَ سُجَّدًا وَقُولُوا حِطَّةٌ نَغْفِرْ لَكُمْ خَطَايَاكُمْ ۚ وَسَنَزِيدُ الْمُحْسِنِينَ  

{وإذ قلنا} لهم بعد خروجهم من التيه {ادخلوا هذه القرية} بيت المقدس أو أريحا {فكلوا منها حيث شئتم رغدا} واسعا لاَ حَجْرَ فيه {وادخلوا الباب} أي بابها {سجداً} منحنين {وقولوا} مسألتنا {حطة} أي أن تحط عنا خطايانا {نغفر} وفي قراءة بالياء والتاء مبنياً للمفعول فيهما {لكم خطاياكم وسنزيد المحسنين} بالطاعة ثواباً.

See similar narrations below:

Collected by Qurʾān
quran:7:161

And ˹mention, O Muhammad˺, when it was said to them, "Dwell in this city and eat from it wherever you will and say, 'Relieve us of our burdens,' and enter the gate bowing humbly; We will ˹then˺ forgive you your sins. We will increase the doers of good ˹in goodness and reward˺."  

And, mention, when it was said to them, ‘Dwell in this city, the Holy House ˹of Jerusalem˺, and eat therein wherever you will, and say, ‘our concern is for ˹an˺, Exoneration,’ and enter the gate, that is, the gate of the city, prostrating, a prostration that is ˹actually˺ a bow. We shall forgive (read naghfir, or the passive tughfar) you your transgressions; We shall give more to those who are virtuous, through obedience, in terms of reward.
القرآن:٧:١٦١

وَإِذْ قِيلَ لَهُمُ اسْكُنُوا هَٰذِهِ الْقَرْيَةَ وَكُلُوا مِنْهَا حَيْثُ شِئْتُمْ وَقُولُوا حِطَّةٌ وَادْخُلُوا الْبَابَ سُجَّدًا نَغْفِرْ لَكُمْ خَطِيئَاتِكُمْ ۚ سَنَزِيدُ الْمُحْسِنِينَ  

{و} اذكر {إذ قيل لهم اسكنوا هذه القرية} بيت المقدس {وكلوا منها حيث شئتم وقولوا} أمرنا {حطَّةٌ وادخلوا الباب} أي باب القرية {سجَّدا} سجود انحناء {نغفر} بالنون والتاء مبينا للمفعول {لكم خطيئاتكم سنزيد المحسنين} بالطاعة ثوابا.