Skip to content

Instantly share code, notes, and snippets.

@sjl
Forked from inky/git vs mercurial
Created December 3, 2009 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sjl/248206 to your computer and use it in GitHub Desktop.
Save sjl/248206 to your computer and use it in GitHub Desktop.
# Discard local changes
git checkout -f (git co -f)
# This will change the current parent revision if you're not at a branch tip.
# The fact that it discards local changes is just a side effect.
hg update --clean (hg co -C)
# What you really want is the command *designed* to throw away changes: revert.
hg revert --all [--no-backup] (hg rev -a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment