Reverse shock emission as a probe of gamma-ray burst ejecta