my dictionary of slang says - with a question mark, so it's not sure - that it might be from a dialect word gaishen, meaning a skeleton or something ridiculous, and so have come to mean something spare.
Once in a while you see a mistake in a newspaper - for instance, where a caption to a photo just reads 'write caption here' and a journalist has forgotten to do so. Journalists refer to the words you see as gash text, something which is meant to replaced by a proper caption.