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
Writing Better Go: Lessons from 10 Code Reviews
konradreiche
3
6.9k
Introduce Hono CLI
yusukebe
6
3.1k
釣り地図SNSにおける有料機能の実装
nokonoko1203
0
200
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
640
NIKKEI Tech Talk#38
cipepser
0
240
Catch Up: Go Style Guide Update
andpad
0
250
Vueのバリデーション、結局どれを選べばいい? ― 自作バリデーションの限界と、脱却までの道のり ― / Which Vue Validation Library Should We Really Use? The Limits of Self-Made Validation and How I Finally Moved On
neginasu
2
1.6k
Go言語はstack overflowの夢を見るか?
logica0419
0
610
Goで実践するドメイン駆動開発 AIと歩み始めた新規プロダクト開発の現在地
imkaoru
4
900
CSC305 Lecture 10
javiergs
PRO
0
260
モテるデスク環境
mozumasu
3
1.3k
スマホから Youtube Shortsを見られないようにする
lemolatoon
27
34k
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
9
640
Build The Right Thing And Hit Your Dates
maggiecrowley
38
2.9k
How to Ace a Technical Interview
jacobian
280
24k
Optimizing for Happiness
mojombo
379
70k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.1k
Gamification - CAS2011
davidbonilla
81
5.5k
Thoughts on Productivity
jonyablonski
70
4.9k
Six Lessons from altMBA
skipperchong
29
4k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.7k
What's in a price? How to price your products and services
michaelherold
246
12k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
10
890
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
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