Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Undo, Redo, Change History with Git
Search
Joshua Wehner
January 28, 2015
Programming
0
120
Undo, Redo, Change History with Git
Undo, Redo and Change History with Git
Joshua Wehner
January 28, 2015
Tweet
Share
More Decks by Joshua Wehner
See All by Joshua Wehner
How to Undo Almost* Anything in Git
jaw6
0
99
Must It Always Be About Sex?
jaw6
2
190
Other Decks in Programming
See All in Programming
Processing Gem ベースの、2D レトロゲームエンジンの開発
tokujiros
2
130
JSONataを使ってみよう Step Functionsが楽しくなる実践テクニック #devio2025
dafujii
1
590
Ruby×iOSアプリ開発 ~共に歩んだエコシステムの物語~
temoki
0
340
print("Hello, World")
eddie
2
530
RDoc meets YARD
okuramasafumi
4
170
Ruby Parser progress report 2025
yui_knk
1
450
AIを活用し、今後に備えるための技術知識 / Basic Knowledge to Utilize AI
kishida
22
5.8k
rage against annotate_predecessor
junk0612
0
170
Deep Dive into Kotlin Flow
jmatsu
1
360
Design Foundational Data Engineering Observability
sucitw
3
200
はじめてのMaterial3 Expressive
ym223
2
880
testingを眺める
matumoto
1
140
Featured
See All Featured
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
The Power of CSS Pseudo Elements
geoffreycrofte
77
6k
Designing Experiences People Love
moore
142
24k
Optimizing for Happiness
mojombo
379
70k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Large-scale JavaScript Application Architecture
addyosmani
513
110k
Building Better People: How to give real-time feedback that sticks.
wjessup
368
19k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
188
55k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
358
30k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
580
Transcript
Undo, Redo Change History with Git
Joshua Wehner • @jaw6 •
[email protected]
• Minneapolis, MN, USA
• GitHub Training
Undo & Redo Scenarios
Undo "Public" Change • It's broken • But it's pushed
• git revert <sha>
Tweak Last Commit • Oooops • Committed too fast •
git commit --amend
Regrets, I've Had a Few • Ooooops • That's mostly
rubbish • git reset <last good sha>
Throw It All Away • It's all rubbish • I
regret everything • git reset --hard <last good sha>
Wait, On Second Thought • Throw It All Away •
Could I maybe get that back? • git reflog git reset --hard <sha>
Well, That Wasn't So Bad • Most of that is
trash • But that one? That one is good. • Gimme. • git cherry-pick <good one>
Put That Thing Over There • I should have made
this branch earlier • Those commits should not be on master • git rebase master
None
None
Well, Then Again • Throw It All Some of It
Away • I regret that one thing • Some of the rest of it was okay • git rebase -i <public sha>
I Was Wrong Before • I thought I was wrong
• But I wasn't • git commit --fixup <sha> git rebase -i --autosquash
Forget I Said That • Stop tracking this file •
I mean it • git rm --cached .gitignore git clean -f (also -x maybe?)
Thank you! Undo, Redo, Change History • @jaw6 •
[email protected]
• http://training.github.com/
I'm Only (Sort of) Kidding • Commit part (just part)
of a file • git add -p