This video will show you how to remap motor outputs in Cleanflight and Betaflight using the mixer and mmix command. The syntax of these commands is a little unintuitive, but not too complicated. This video will also show you some gotchas of using these commands that commonly trip up people who try to use them. First, you must set "mixer custom" or your custom mix won't take effect. Second, you can't skip mixer lines even if you don't intend to use a particular motor header. If that doesn't immediately make sense, the video will show it clearly.
There are several reasons why you might need to remap motor outputs in Cleanflight or Betaflight. One reason is if you have a bad motor header and need to move a motor to a different header. Another reason is if you are coming from OpenPilot and have your motors soldered to the board. OpenPilot uses a different motor layout than Cleanflight. Remapping motor outputs will let you keep the OpenPilot layout while switching to Cleanflight. A third reason is if you have a custom copter motor layout.