Appeals court orders return of man's medical marijuana