Can you remove a commit made to a branch on AWS code commit?
Simplest answer is to just revert the commit.  AWS Code Commit is standard Git and will support everything Git allows you to do.
I.e. find commit hash:
git log -n1
commit 444c954e458cc446e2a7a1f2659adf71bdf55580 (HEAD -&gt; my-branch, origin/my-branch)

Then do the revert:
git revert 444c954e458cc446e2a7a1f2659adf71bdf55580
git push

It'll revert your repo to whatever state it would be without that specific commit.  Note that if you have other commits that modified the same files afterward, you will have a merge conflict and will have to fix them manually.