Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
StatisticsUndoing changes in git
I. Undoing committed changes
II. Reverting pushed changes
III. Discarding local changes
How can I undo committed changes?
Mark
I don’t need this
change!
git reset --hard to_commit
Link to git help
Commit is no
longer here!
To undo commited changes I will use
`git reset --hard to_commit`
How can I revert pushed changes?
Mark, remove
that feature
users don’t use the feature
git revert commit
Link to git help
Without the
feature, users are
happy!
it was
reverted
To revert public changes I will use
`git revert commit`
How can I discard local changes?
Mark
git checkout -- todo.txt
Link to git help
Local changes have
been discarded!
To discard local changes I will use`git
checkout -- todo.txt`
I. Undoing committed changes
II. Reverting pushed changes
III. Discarding local changes
Use git
Thanks!
Upcoming SlideShare
Loading in …5
×

Undoing changes in git

251 views

Published on

Based on a simple story about Mark, a software developer, I'm guiding you how to undo changes in git. How to undo commited changes, how to revert changes that were pushed into the master branch, and how to reject local changes.

The presentation does not cover other solutions to undo changes. The idea is to encourage developers to use console git over plugins for editors like RubyMine or Atom.

Console git works everywhere the same way. When you pair-program with a remote team member, console git gives you more flexibility and reliability.



Published in: Technology
  • Be the first to comment

  • Be the first to like this

Undoing changes in git

  1. 1. StatisticsUndoing changes in git
  2. 2. I. Undoing committed changes II. Reverting pushed changes III. Discarding local changes
  3. 3. How can I undo committed changes?
  4. 4. Mark I don’t need this change!
  5. 5. git reset --hard to_commit Link to git help
  6. 6. Commit is no longer here!
  7. 7. To undo commited changes I will use `git reset --hard to_commit`
  8. 8. How can I revert pushed changes?
  9. 9. Mark, remove that feature users don’t use the feature
  10. 10. git revert commit Link to git help
  11. 11. Without the feature, users are happy! it was reverted
  12. 12. To revert public changes I will use `git revert commit`
  13. 13. How can I discard local changes?
  14. 14. Mark
  15. 15. git checkout -- todo.txt Link to git help
  16. 16. Local changes have been discarded!
  17. 17. To discard local changes I will use`git checkout -- todo.txt`
  18. 18. I. Undoing committed changes II. Reverting pushed changes III. Discarding local changes
  19. 19. Use git
  20. 20. Thanks!

×