Your comment wasn't deleted. The answer was deleted by the person who posted it, and since you had left the comment under the answer, the deletion of the answer also removed your comment:
That said, you should always expect comments to be deleted. They are supposed to be ephemeral and, ideally, ask for clarifications or provide new info that can be integrated into the answer/question. So if you want something to stay, post a full answer, not a comment. For more details, see https://unix.stackexchange.com/help/privileges/comment:
Comments are temporary "Post-It" notes left on a question or answer. They can be upvoted (but not downvoted) and flagged, but do not generate reputation. There's no revision history, and when they are deleted they're gone for good.