What @Alexandre suggests is true. The question itself had two problems:
- It was two completely separate questions with different answers
- The second part was "How do I get started" kind of question which is not welcome in this community.
So @Josh (one of site moderators), truncated the second part fixing both issues. Obviously it rendered your answer unrelated. and hence you got down-votes.
This was what happened, but to answer your question, you can delete your answer, and you'll get your lost points back. But it might take a while, till the site crawler sees that deleted answer and give back your points. So if you don't get your reputation back instantly, just be patient.
Also as a notice, you might sometimes lose points because of answer/question deletion too. The most likely scenario would be you answering a question, and get a few upvotes for that. If for some reason OP decides to remove that question (or the question is migrated to other channels or ...) you end up losing all the reputation you earned for your answer.