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
140
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Undo, Redo, Change History with Git
Undo, Redo and Change History with Git
Joshua Wehner
January 28, 2015
More Decks by Joshua Wehner
See All by Joshua Wehner
How to Undo Almost* Anything in Git
jaw6
0
110
Must It Always Be About Sex?
jaw6
2
200
Other Decks in Programming
See All in Programming
使いながら育てる Claude Code — 開発フローの1コマンド化 × 繰り返し指摘の自動仕組み化
shiki_kakaku
1
2k
プロポーザルを書いてもらう
pvcresin
0
590
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
270
Detecting Compromised CI with eBPF and Cilium Tetragon
lizrice
0
270
[PyCon KR 2026] More Variants, More Diversity for AI Accelerators
achimnol
0
120
思考垂れ流し開発 ~音声入力 × AIエージェント × 開発ハーネスによる試行錯誤~
npostring
0
410
Japan Community Day at Kubecon + CloudNativeCon Japan 2026: Learning Container Privilege Control by Building My Own Low-Level Container Runtime
ternbusty
1
170
属人化した知識を、 AIが辿れる地図にする
pkshadeck
PRO
1
220
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
440
Oxlintはいいぞ(続)
yug1224
1
480
Go 1.27からのGODEBUG / Go 1.27 リリースパーティ #go127party
mazrean
0
260
tsc.rip を支える技術 / Kyoto.なんか #8
susisu
0
3.8k
Featured
See All Featured
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
290
Thoughts on Productivity
jonyablonski
76
5.3k
Designing Powerful Visuals for Engaging Learning
tmiket
1
510
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
260
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
We Are The Robots
honzajavorek
0
310
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
260
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.1k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
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