1

If first stitch is a knit, make a reverse yarn over by taking yarn round right hand needle in the opposite direction to normal.

2

Knit next stitch. Two stitches on right hand needle (the reverse yarn over and the stitch just knitted).

3

On the first stitch only, lift first stitch (the reverse yarn over) over stitch just knitted.

4

When working a k1, p1 rib, the next stitch will be a purl, so make a knit-to-purl yarn over by taking yarn from front to back to front between needles, over right hand needle from front to back, bringing it between needles again and holding it to front. Purl next stitch.

5

You will have 3 stitches on right hand needle, the stitch remaining from step 1, the yarn over and the purl stitch both from step 4. Insert left hand needle into both the stitch from step 1 and yarn over. Use top of left hand needle to lift these 2 stitches over purl stitch. One stitch remains on right hand needle.

6

Before the next (and every subsequent) knit stitch, make reverse yarn over by holding yarn to back as normal then going right to left over the front of the right hand needle, taking yarn between needles, under the right hand needle and holding to the right.

7

Knit next stitch. You will have 3 stitches on right hand needle: the purl stitch from step 3, the reverse yarn over and the stitch just knitted. With tip of left hand needle, lift both reverse yarn over and purl stitch over the stitch just knitted. Repeat steps 4-6 until all (or specified number) of stitches have been cast off.  

8

Where all stitches are to be cast off, finish by cutting the yarn, leaving a tail of around 20cm (longer if you will be using this to sew up with later). Pass the cut end through the final stitch on the right hand needle and draw up firmly.