Keyboard shortcut to revert selected local changes in Cursor

WebStorm shortcuts deeply rooted in muscle memory are hard to ignore when using other IDE’s. A frequent flyer for me is the shortcut to ‘rollback’ lines in WebStorm with cmd + opt + z .

In Cursor there is no such shortcut defined by default so you have to remove changes manually or click in the margin to open the local changes view then click the Revert Change button. That feels like too much work when already used to a shortcut for this.

To add the same shortcut in Cursor IDE, open keybindings.json via the command palette.

Keyboard Shortcuts: Open Keyboard Shortcuts (JSON)

and add the following…

{
	"key": "alt+cmd+z",
	"command": "git.revertSelectedRanges",
	"when": "editorTextFocus && gitOpenRepositoryCount != 0"
}

For reference the file is located in /Users/<user>/Library/Application Support/Cursor/User/keybindings.json on mac.