Reverse a sequence