“With all dharmas left behind, come to me alone for shelter. From all sins I will set you free; do not be sorrowful.”
Going deeper
Arjuna's plea and this answer stand at opposite ends of the teaching. 2.7 is in chapter 2. His heart is stricken, his mind is perplexed about his duty, and he implores Kṛṣṇa to tell him for certain what is good for him, calling himself a disciple who has taken refuge. The verse before, 2.6, says he does not even know which outcome of the battle would be better. 18.66 comes near the close of chapter 18. The verse before it, 18.65, tells Arjuna to focus his mind on Kṛṣṇa and be his devotee, and promises that he will come to him, for he is dear to him. Then 18.66 says that Arjuna should relinquish all Dharmas completely and seek Kṛṣṇa alone for refuge, that Kṛṣṇa will release him from all sins, and that he should not grieve. The Sanskrit for refuge is śaraṇam, and for grieve not, mā śucaḥ. 18.67 follows with those who should not be told this. See what the Gītā says about liberation.