Results for “keep original”
Small, practical examples. Search by task or narrow things down below.
Restore a form’s original default values
jQuery: Call the native reset method through the underlying form element.
jQuery✓ Tested
Return to the original branch
Git: Return to the original branch inside the disposable repository created by the input setup.
Git✓ Tested
Reverse a copy while preserving the original
JavaScript: Copy before reverse because reverse mutates the array it receives.
JavaScript✓ Tested
Reverse a copy while preserving the original
TypeScript: Copy before reverse because reverse mutates the array it receives.
TypeScript✓ Tested
Sort a copy without mutating the original list
Sort a copy without mutating the original list with a small React component and explicit browser behavior.
React✓ Tested
Start a disclosure open while keeping it collapsible
HTML: The open attribute sets the initial details state without JavaScript.
HTML✓ Tested
Stop tracking a generated file while keeping it locally
Git: Removing a path from the index leaves its working copy intact when cached is specified.
Git✓ Tested
Uncommit the latest local change while keeping it staged
Git: A soft reset moves the branch tip but preserves both index and working files.
Git✓ Tested
Unstage a file while keeping its contents
Git: Unstage a file while keeping its contents inside the disposable repository created by the input setup.
Git✓ Tested
Stash unstaged work while leaving staged edits available
Git: Keep-index preserves the staged state for testing or committing while stashing the rest.
Git✓ Tested
Unstage a file without losing edits
Return a staged change to the working tree.
restore✓ Tested
Accept either of two conditions
SQL: Use OR to keep matching names or out-of-stock rows.
SQL✓ Tested