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
【やさしく解説 設計編・中級 #1】一つの車に、運転手は一人 ~ある倉庫システムの事例から~
panda728
PRO
0
170
地域 SRE コミュニティ最前線 - ホンマでっかSRE勉強会
tk3fftk
0
220
「なぜそう決めたのか」を残し続ける仕組み ― Notion AI カスタムエージェント × Slack連携による設計判断の自動記録 - NIKKEI Tech Talk #47
niftycorp
PRO
0
260
なぜ型を書くのか? TSKaigi2026で改めて考える #tskaigi_smarthr
kajitack
0
350
Developing with AI Agents — Codex, Claude Code & Cowork Practical Guide
x5gtrn
PRO
0
1.4k
「正の参照」と 「負の導出」で組む ハーネスエンジニアリング
cottpan
1
140
関数型プログラミングのメリットって何だろう?
wanko_it
0
170
Claude Opus 4.6以後の受託開発エンジニアの変化(Claude Code開発ノウハウ大公開スペシャルbyクラスメソッド)
iidatakuma
1
620
言語を使う側から、作る側へ。 自作 Lisp で得た新たな気づき。
andpad
0
110
SLOをサービス品質の共通言語にするために 取り組んできたこと
wakana0222
0
480
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
0
100
Performance Engineering for Everyone
elenatanasoiu
0
270
Featured
See All Featured
Un-Boring Meetings
codingconduct
0
340
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
360
What's in a price? How to price your products and services
michaelherold
247
13k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6k
The Curse of the Amulet
leimatthew05
2
13k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
We Have a Design System, Now What?
morganepeng
55
8.2k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
220
It's Worth the Effort
3n
188
29k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
390
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
190
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