Does Google Analytics track localhost activity?
Go to Admin in Google Analytics, in the third column click on Filters.
Add a filter that only includes the hostname you do want to track, that way anything else, include localhost, will be excluded from your data going forward.
It's not possible to correct data that has already been gathered.