undo command

This commit was sponsored by Andrew Cant.
This commit is contained in:
Joey Hess 2014-11-13 16:41:21 -04:00
parent d22d650f59
commit 13260ccc3a
7 changed files with 139 additions and 6 deletions

View file

@ -282,6 +282,22 @@ subdirectories).
are on a video hosting site, and the video is downloaded. This allows
importing e.g., youtube playlists.
* `undo [filename|directory] ...`
When passed a filename, undoes the last change that was made to that
file.
When passed a directory, undoes the last change that was made to the
contents of that directory.
Running undo a second time will undo the undo, returning the working
tree to the same state it had before. In order for undoing an undo of
staged changes, any staged changes are first committed by the
undo command.
Note that this does not undo get/drop of a file's content; it only
operates on the file tree committed to git.
* `watch`
Watches for changes to files in the current directory and its subdirectories,

View file

@ -80,5 +80,7 @@ the last change to each file would be expensive, and likely confusing.
Instead, when a directory is passed, it could find the most recent commit
that touched files in that directory, and undo the changes to those files.
> [[done]] --[[Joey]]
Also, --depth could make undo look for an older commit than the most
recent one to affect the specified file.