Pekka has already given the correct solution when the "@" that you want to include is in a piece of code: use backticks.
I think it's important to mention that for other kinds of content, backticks are inappropriate, because they would mark a word or phrase as code in the resulting HTML, when it is not in fact code.
For those cases, using quotation marks would likely be the best choice. If that also seems inappropriate, you can perform a pseudo-escape of the at symbol by preceding it with any other character, like: "\@". The backslash is not actually significant: you can use any character you like (except possibly another "@") to prevent the software from interpreting the at symbol as an @mention. Note also that the pseudo-escape character will appear in the rendered comment.
My similar answer on Meta.SO, with demonstrations: Using @ sign in comments to call out users makes it difficult to discuss certain iOS topics