To undo an action on a Mac, you can use the “Command” + “Z” keyboard shortcut. This shortcut will undo the most recent action that you performed.
You can also use the “Edit” menu to undo an action. To do this, go to the “Edit” menu and select “Undo” or use the “Command” + “Shift” + “Z” keyboard shortcut.
If you want to redo an action that you have undone, go to the “Edit” menu and select “Redo” or use the “Command” + “Shift” + “Z” keyboard shortcut again.
Please note that the ability to undo and redo actions is not available in all apps or for all actions. Some actions, such as deleting a file, cannot be undone. Check the documentation for the app that you are using for specific information on what actions can be undone.