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
130
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
110
Must It Always Be About Sex?
jaw6
2
200
Other Decks in Programming
See All in Programming
Railsの気持ちを考えながらコントローラとビューを整頓する/tidying-rails-controllers-and-views-as-rails-think
moro
4
380
オブザーバビリティ駆動開発って実際どうなの?
yohfee
3
780
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
340
TROCCOで実現するkintone+BigQueryによるオペレーション改善
ssxota
0
160
Ruby x Terminal
a_matsuda
7
590
grapheme_strrev関数が採択されました(あと雑感)
youkidearitai
PRO
1
210
文字コードの話
qnighy
44
17k
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
1.9k
RAGでハマりがちな"Excelの罠"を、データの構造化で突破する
harumiweb
9
2.6k
技術検証結果の整理と解析をAIに任せよう!
keisukeikeda
0
100
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
300
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
220
Featured
See All Featured
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
82
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
240
Navigating Weather and Climate Data
rabernat
0
130
Into the Great Unknown - MozCon
thekraken
40
2.3k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Between Models and Reality
mayunak
2
230
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
260
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.4k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.8k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.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