Skip to content

Instantly share code, notes, and snippets.

@Lecarvalho
Last active June 14, 2021 18:47
Show Gist options
  • Save Lecarvalho/ab7b0905ae0137672c1909cfa571fdad to your computer and use it in GitHub Desktop.
Save Lecarvalho/ab7b0905ae0137672c1909cfa571fdad to your computer and use it in GitHub Desktop.
# Discard all local commits
git reset --hard origin/[branch]
# Discard last commit on remote and discard local changes
git reset --hard HEAD~1
# Discard last commit on remote and keep change files in local
git reset --soft HEAD~1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment