There are 4 wires connected to the motor. There's an online document here:
https://s3.amazonaws.com/screensteps_live/attachment_assets/assets/000/276/722/original/2016-12-21_spec_sheet_-_Bosch_FRC_motor_6_004_.pdf?1482352535 (https://s3.amazonaws.com/screensteps_live/attachment_assets/assets/000/276/722/original/2016-12-21_spec_sheet_-_Bosch_FRC_motor_6_004_.pdf?1482352535)
The actual wires on the motor are not colored as in the doc. Here's what they really are:
Orange - thin: Ground
Green - thin: encoder output
Brown - thick: Power (-)
Green - thick: Power (+)
Note that there are 2 green wires but one is thick and one is thin. Don't mix the two wires!