In the example you provided, it depends on how valuable it is to know the incorrect solutions.
If the answer is "it's very important, as I'm likely to do them again," then absolutely leave them. That is valuable history for anyone working on the project later.
If the answer is "they were silly typos, just took CI to find them for me" then I'd say they should be cleaned up. That way your git blame will be a very clear picture of what changed, rather than cluttered with a useless previous revision. This is incredibly helpful when using git blame in your tooling to show the commit that last changed a file/line.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
In the example you provided, it depends on how valuable it is to know the incorrect solutions.
If the answer is "it's very important, as I'm likely to do them again," then absolutely leave them. That is valuable history for anyone working on the project later.
If the answer is "they were silly typos, just took CI to find them for me" then I'd say they should be cleaned up. That way your git blame will be a very clear picture of what changed, rather than cluttered with a useless previous revision. This is incredibly helpful when using git blame in your tooling to show the commit that last changed a file/line.