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
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
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
0
280
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
140
3Dシーンの圧縮
fadis
1
560
LLM Plugin for Node-REDの利用方法と開発について
404background
0
150
Migrations : C'est une question d'hygiène !
vinceamstoutz
0
2.7k
初めてのRubyKaigiはこう見えた
jellyfish700
0
380
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
2.5k
Zod v4 Codec でスキーマに型変換を埋め込む REST API 設計 #TSKaigi2026
ryutaro_yako
0
180
Modding RubyKaigi for Myself
yui_knk
0
840
Talking to terminals (and how they talk back) (KotlinConf 2026)
jakewharton
PRO
1
170
[KCD Czech] eBPF Meets the GPU: Future of AI Infra Observability
doniacld
0
130
SPMマルチモジュールで テストカバレッジを取得する技法
yosshi4486
0
130
Featured
See All Featured
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.3k
New Earth Scene 8
popppiees
3
2.3k
The agentic SEO stack - context over prompts
schlessera
0
790
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
460
Paper Plane (Part 1)
katiecoart
PRO
0
8.1k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
600
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.8k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
810
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2k
A Tale of Four Properties
chriscoyier
163
24k
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