Discard and checkpoints
Discarding throws away a file's changes in your working folder.
Before it does, Commitline keeps a checkpoint, a copy of the folder, so you can take the discard back.
Discard a file's changes
- In the Git view, under Changes, choose the discard button on the file; its tooltip reads Discard changes to and the file's name.
- Commitline asks Discard changes? and says what will happen:
- for a file Git tracks, its changes are lost, and it goes back to what's staged;
- for a new file Git doesn't track yet, discarding deletes it.
- Choose Discard.


You discard one file at a time; there's no Discard all.
A staged change isn't touched: unstage it first if you want it gone too.
Take a discard back
After a discard, the Git view says Discarded the changes to the file, with Undo and Dismiss.
Undo puts back only the files you discarded; every other file, what's staged and your branches stay as they are.


You can also take it back later with Ctrl+Z (⌘Z on a Mac), or from Recent actions, while Commitline is still running; see Undo.
Checkpoints
A checkpoint is a copy of the repository's working folder, taken just before a discard.
- It's kept in Commitline's own data folder, never in your repository, and never touches your branches, commits, stashes or Git settings.
- Each
.gitfolder is left out, and so are files over 10 MiB. - When new and changed files add up to more than 1 GiB, no checkpoint is taken, and then nothing is discarded.
- Commitline needs 2 GiB of free disk space beyond what a checkpoint adds.
With less, it says Checkpoints paused, and nothing is discarded.
Settings › Checkpoints › Follow .gitignore files leaves out the files your .gitignore files ignore.
It's off by default, so a checkpoint keeps them too.
Checkpoints stay until they're deleted.
Deleting them from Commitline is planned for a later version.
Only a discard takes a checkpoint.
Commitline's other actions take back their changes with Git itself; see Undo.
Without checkpoints
Checkpoints are a module, and View › Modules… can turn them off.
Then Discard changes? says This can't be undone., and a discard is final.