Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 706 Bytes

36re.md

File metadata and controls

30 lines (20 loc) · 706 Bytes

cli.git.revert

This is best used when you want to revert a commit that you've alredy pushed to a remote

Synopsis

  git revert [-flags] [<commitid>]

Cookbook

How to undo the changes that a commit made

This will revert the changes that a previous commit on the history made while keeping the changes that the commits after the one you want to revert made

This will introduce a new commit without the changes that the reverted commit made

  git revert <commitid>
  git push

Revert the changes of a commit

If you want to revert the changes you did on a commit and you haven't yet pushed them, then you may be better off with reset