Create a mask
Method 1
Select all the layers you want to mask
Hit ⌘⌃M to create the mask group: the last layer of the selection will be used to mask all the other layers of the selection
Method 2
Alternatively, you can right-click on your selection, and select “Mask”
Remove a mask
Method 1
Select the masked group
Hit ⇧⌘⌃M (or ⇧⌘G) to ungroup
Method 2
Alternatively, you can right-click ont he masked group, and select “Ungroup”