Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 764 Bytes

20180131-notes.md

File metadata and controls

26 lines (21 loc) · 764 Bytes
title layout
(emacs-berlin 'archive')
default

{::options parse_block_html="true" /}

Using our collective wisdom we did some mob programming and created a useful litte function to undo the latest commit of a git repository. We also managed to get the *scratch* buffer into a state where it wouldn't display its contents anymore and had to start over. And learnt the basics of the prefix argument.

(defun magit/undo-last-commit (number-of-commits)
  "Undoes the latest commit or commits without loosing changes"
  (interactive "P")
  (let ((num (if (numberp number-of-commits)
                 number-of-commits
               1)))
    (magit-reset (format "HEAD^%s" num))))