Switching from Computer Science to Historical Linguistics for Master's degree
If this is in the US where the undergraduate degree is very generalized then you might be able to go directly to a graduate program in linguistics. You should at least explore that by either visiting a university with the desired program or applying. Of course, your application will need to stress the things that make you suitable for a switch and good reasons to expect success, but everyone needs to do the latter. 

But repeating a US undergraduate degree would also mean repeating a lot of things that you already know because of the long list of requirements. Much of what you already studied in the humanities as part of a CS degree are exactly the same as if you'd studied linguistics from the start. You are missing a few key courses, obviously, but a master's degree, which is more specialized would probably let you fill in any blanks. 

For places with a very different educational structure, like UK with its more specialized undergraduate program, this path might be less feasible, but might be possible even there. But you won't know that until you actually explore it directly. 

However, being successful in any undergraduate degree gives you two vital skills that become more important as you go along. The first is the ability to learn and to demonstrate that you can. The second is the ability to write and to otherwise express your thoughts. Those are both strong indicators of future success in any field.