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
これからAgentCoreを触る方へトレンドはGatewayです
har1101
6
490
なぜ関数型プログラミングで「型」と「証明」が語られるのか #fp_matsuri
kajitack
3
810
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
370
初めてのKubernetes 本番運用でハマった話
oku053
0
120
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
12
4.7k
信頼性について考えてみる(SRE NEXT 2026 miniLT)
hayama17
0
170
symfony/aiとlaravel/boost
77web
0
120
言語を使う側から、作る側へ。 自作 Lisp で得た新たな気づき。
andpad
0
110
はてなアカウント基盤 State of the Union
cockscomb
1
1.3k
フィードバックで育てるAI開発
kotaminato
1
110
Performance Engineering for Everyone
elenatanasoiu
0
270
分散システム、なんですぐ死んでしまうん?耐障害性を高めたいあなたのためのレジリエンスパターン入門
mshibuya
7
5.8k
Featured
See All Featured
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
230
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
260
Designing for Performance
lara
611
70k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.1k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
270
New Earth Scene 8
popppiees
3
2.4k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.6k
Optimising Largest Contentful Paint
csswizardry
37
3.8k
Skip the Path - Find Your Career Trail
mkilby
1
170
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
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