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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Joshua Wehner
January 28, 2015
Programming
130
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
Agentic AI: Evolution oder Revolution
mobilelarson
PRO
0
220
Redox OS でのネームスペース管理と chroot の実現
isanethen
0
500
L’IA au service des devs : Anatomie d'un assistant de Code Review
toham
0
160
おれのAgentic Coding 2026/03
tsukasagr
1
120
「効かない!」依存性注入(DI)を活用したAPI Platformのエラーハンドリング奮闘記
mkmk884
0
290
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
4
1.5k
存在論的プログラミング: 時間と存在を記述する
koriym
5
740
Understanding Apache Lucene - More than just full-text search
spinscale
0
150
AI時代の脳疲弊と向き合う ~言語学としてのPHP~
sakuraikotone
1
1.8k
The free-lunch guide to idea circularity
hollycummins
0
390
ファインチューニングせずメインコンペを解く方法
pokutuna
0
250
Ruby and LLM Ecosystem 2nd
koic
1
1.4k
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
9
800
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
300
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
92
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
340
Mind Mapping
helmedeiros
PRO
1
140
YesSQL, Process and Tooling at Scale
rocio
174
15k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
170
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2k
How GitHub (no longer) Works
holman
316
150k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.1k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
290
Abbi's Birthday
coloredviolet
2
6.2k
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