OK, somebody petitioned the court for an injunction to stop you from doing whatever you're doing. A hearing has been scheduled for some future date.
You want to file a response asking that the petition be dismissed because you have stopped doing what you were doing and promise not to do it again.
Yes, you can certainly to that, either at the hearing or in advance of the hearing. It's preferable that you do it far enough in advance so that the petitioner gets your response.
Then it's up to the petitioner to agree to dismiss or continue to seek the injunction and get it on record in case you renege on your promise at some future date.
You wrote that a claim "includes" an injunction, implying that the claim also includes something else.
What else?
Are you also being sued for monetary damages as part of the claim?