undoing changes in git

Post on 14-Jan-2017

76 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

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!

top related