X[::-1] indexing applies: indices of X from first to last in steps of -1.
b=X[:, ::-1, :, :] - Reverse image up/down.
c=X[:, ::-1, ::-1, :] - Reverse image up/down and left/right.
d=X[:, :, ::-1, :] - Reverse image left/right.
Remark:
:: is not an operator, it's actually two : operators one after the other.
X[::-1] is the same as X[ : : -1].
Refer to Indexing documentation.
The basic slice syntax is i:j:k where i is the starting index, j is the stopping index, and k is the step.
If i is not given it defaults to 0
If j is not given it defaults to n
Writing [: : -1], omits i and j, and sets k to -1.
The syntax means: "from index 0, take all elements, with step -1", that gives all elements in reverse order (all elements along this axis).
Example:
import cv2
import numpy as np
# Build input:
im = cv2.imread('chelsea.png')
im = cv2.resize(im, (96, 96))
X = np.empty((1, im.shape[0], im.shape[1], im.shape[2])).astype(np.uint8)
X[0, :, :, :] = im
b = X[:, ::-1, :, :]
c = X[:, ::-1, ::-1, :]
d = X[:, :, ::-1, :]
Result:
im:

b:

c:

d:

Note:
I kind of ignored the fist index because the dimension is 1.
In case of multiple frames, it's common for the fist index to apply the number of frames.