Function: magit-unstage-files

magit-unstage-files is an interactive and natively compiled function defined in magit-apply.el.

Signature

(magit-unstage-files FILES)

Documentation

Read one or more files and unstage all changes to those files.

Key Bindings

magit-mode-map u

Source Code

;; Defined in /nix/store/irvbdy0zra0dn8fpd008f32x5ix6qm5v-emacs-packages-deps/share/emacs/site-lisp/elpa/magit-20261005.508/magit-apply.el
;;;###autoload
(defun magit-unstage-files (files)
  "Read one or more files and unstage all changes to those files."
  (interactive
    (let* ((choices (magit-staged-files))
           (default (or (magit-section-value-if 'file)
                        (magit-file-relative-name)))
           (default (car (member default choices))))
      (list (magit-completing-read-multiple "Unstage file,s: " choices
                                            nil t nil nil default))))
  (magit-with-toplevel
    (magit-unstage-1 files)))