You could look on it like this:
A: [Do me a favor* - ] tell him I said hello
B: You [have] got it.
As others have said, the 'it' is the doing of the thing requested.
*I've omitted the u, because this idiom is not widely used in Br Eng (yet). 'I got it', in Br Eng, usually has the meaning 5jj gave - with 'it' meaning the thing understood rather than the thing requested. (Language-watchers may be interested to know that this usage was, in my childhood, decried as an Americanism. As they say in America (and increasingly here too) 'What goes around comes around'!.)
b