Undoing changes in git

Wojtek Ryrych
Wojtek Ryrychagile writer, software developer
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!
1 of 20

Recommended

Toolbox Design • Xin Cuisine Menu by
Toolbox Design • Xin Cuisine MenuToolbox Design • Xin Cuisine Menu
Toolbox Design • Xin Cuisine MenuToolbox Design
58 views9 slides
13 10 08 city of san antonio manager review by
13 10 08 city of san antonio manager review13 10 08 city of san antonio manager review
13 10 08 city of san antonio manager reviewAndrew Douglas
501 views32 slides
BVI Home Rev A 2017 by
BVI Home Rev A 2017BVI Home Rev A 2017
BVI Home Rev A 2017Peter Carfoot
36 views1 slide
Git undo by
Git undoGit undo
Git undoAvilay Parekh
1K views37 slides
Git tutorial undoing changes by
Git tutorial   undoing changesGit tutorial   undoing changes
Git tutorial undoing changesLearningTech
562 views38 slides
Git, GitHub and Open Source by
Git, GitHub and Open SourceGit, GitHub and Open Source
Git, GitHub and Open SourceLorna Mitchell
2.2K views40 slides

More Related Content

Similar to Undoing changes in git

How to Really Get Git by
How to Really Get GitHow to Really Get Git
How to Really Get GitSusan Tan
1.8K views57 slides
Managing e commerce systems codebase with git by
Managing e commerce systems codebase with gitManaging e commerce systems codebase with git
Managing e commerce systems codebase with gitBruno Ricardo Siqueira
1.1K views88 slides
Git tips by
Git tipsGit tips
Git tipsArthur Shvetsov
671 views62 slides
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23 by
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23msohn
848 views22 slides
TECH MEETUP - From the groud up with GIT by
TECH MEETUP - From the groud up with GITTECH MEETUP - From the groud up with GIT
TECH MEETUP - From the groud up with GITSantex Group
175 views22 slides
From CVS to GIT by
From CVS to GITFrom CVS to GIT
From CVS to GITRoc Boronat
3.8K views33 slides

Similar to Undoing changes in git(20)

How to Really Get Git by Susan Tan
How to Really Get GitHow to Really Get Git
How to Really Get Git
Susan Tan1.8K views
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23 by msohn
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23
msohn848 views
TECH MEETUP - From the groud up with GIT by Santex Group
TECH MEETUP - From the groud up with GITTECH MEETUP - From the groud up with GIT
TECH MEETUP - From the groud up with GIT
Santex Group175 views
From CVS to GIT by Roc Boronat
From CVS to GITFrom CVS to GIT
From CVS to GIT
Roc Boronat3.8K views
Git for Beginners by Rick Umali
Git for BeginnersGit for Beginners
Git for Beginners
Rick Umali659 views
Git: Why And How to by lanhuonga3
Git: Why And How toGit: Why And How to
Git: Why And How to
lanhuonga3677 views
Git with the flow by Dana White
Git with the flowGit with the flow
Git with the flow
Dana White206 views
How to make friends with git by Ilya Vorobiev
How to make friends with gitHow to make friends with git
How to make friends with git
Ilya Vorobiev348 views
Pro git - grasping it conceptually by seungzzang Kim
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptually
seungzzang Kim7.3K views
Improving your workflow with git by Dídac Ríos
Improving your workflow with gitImproving your workflow with git
Improving your workflow with git
Dídac Ríos251 views
Git lord | A brief intro about git commands in Star Wars theme by Akarsh Satija
Git lord | A brief intro about git commands in Star Wars themeGit lord | A brief intro about git commands in Star Wars theme
Git lord | A brief intro about git commands in Star Wars theme
Akarsh Satija336 views
Git basics to advance with diagrams by Dilum Navanjana
Git basics to advance with diagramsGit basics to advance with diagrams
Git basics to advance with diagrams
Dilum Navanjana806 views
Advanced Git Tutorial by Sage Sharp
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
Sage Sharp11.7K views

Recently uploaded

Tunable Laser (1).pptx by
Tunable Laser (1).pptxTunable Laser (1).pptx
Tunable Laser (1).pptxHajira Mahmood
24 views37 slides
From chaos to control: Managing migrations and Microsoft 365 with ShareGate! by
From chaos to control: Managing migrations and Microsoft 365 with ShareGate!From chaos to control: Managing migrations and Microsoft 365 with ShareGate!
From chaos to control: Managing migrations and Microsoft 365 with ShareGate!sammart93
9 views39 slides
The details of description: Techniques, tips, and tangents on alternative tex... by
The details of description: Techniques, tips, and tangents on alternative tex...The details of description: Techniques, tips, and tangents on alternative tex...
The details of description: Techniques, tips, and tangents on alternative tex...BookNet Canada
126 views24 slides
Special_edition_innovator_2023.pdf by
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdfWillDavies22
17 views6 slides
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...James Anderson
66 views32 slides
Perth MeetUp November 2023 by
Perth MeetUp November 2023 Perth MeetUp November 2023
Perth MeetUp November 2023 Michael Price
19 views44 slides

Recently uploaded(20)

From chaos to control: Managing migrations and Microsoft 365 with ShareGate! by sammart93
From chaos to control: Managing migrations and Microsoft 365 with ShareGate!From chaos to control: Managing migrations and Microsoft 365 with ShareGate!
From chaos to control: Managing migrations and Microsoft 365 with ShareGate!
sammart939 views
The details of description: Techniques, tips, and tangents on alternative tex... by BookNet Canada
The details of description: Techniques, tips, and tangents on alternative tex...The details of description: Techniques, tips, and tangents on alternative tex...
The details of description: Techniques, tips, and tangents on alternative tex...
BookNet Canada126 views
Special_edition_innovator_2023.pdf by WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2217 views
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson66 views
Perth MeetUp November 2023 by Michael Price
Perth MeetUp November 2023 Perth MeetUp November 2023
Perth MeetUp November 2023
Michael Price19 views
6g - REPORT.pdf by Liveplex
6g - REPORT.pdf6g - REPORT.pdf
6g - REPORT.pdf
Liveplex10 views
Business Analyst Series 2023 - Week 3 Session 5 by DianaGray10
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5
DianaGray10237 views
Unit 1_Lecture 2_Physical Design of IoT.pdf by StephenTec
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdf
StephenTec12 views
Spesifikasi Lengkap ASUS Vivobook Go 14 by Dot Semarang
Spesifikasi Lengkap ASUS Vivobook Go 14Spesifikasi Lengkap ASUS Vivobook Go 14
Spesifikasi Lengkap ASUS Vivobook Go 14
Dot Semarang37 views
STPI OctaNE CoE Brochure.pdf by madhurjyapb
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdf
madhurjyapb13 views
Voice Logger - Telephony Integration Solution at Aegis by Nirmal Sharma
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at Aegis
Nirmal Sharma31 views
PharoJS - Zürich Smalltalk Group Meetup November 2023 by Noury Bouraqadi
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi126 views
Five Things You SHOULD Know About Postman by Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman30 views
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors by sugiuralab
TouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective SensorsTouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective Sensors
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors
sugiuralab19 views

Undoing changes in git