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
86
Must It Always Be About Sex?
jaw6
2
180
Other Decks in Programming
See All in Programming
CQRS meets modern Java
simas
PRO
2
480
Timeline エディター拡張入門
yucchiy
0
460
Embedding it into Ruby code
soutaro
2
520
Docker_OSS_ホスティング入門
satokoki645
0
140
TypeScriptのパフォーマンス改善
yajihum
14
5.3k
TypeScriptの型とパフォーマンス (TSKaigi 2024)
ypresto
15
5.3k
Deep Dive into React Stream/Serialize
mugi_uno
4
900
ts-morphを使ってコードリプレイスとASTへのハードルを下げる!
nyawach
5
340
How to implement a RubyVM with PHP?
memory1994
PRO
2
1.2k
RubyGems on ruby.wasm
kateinoigakukun
0
180
Slackワークフローで感謝を伝える機能/WiFi 自動接続/Figma to React Component/障害レポート君 Team3@NOT A HOTEL
nakaohiroshi
0
320
Next.js App Router
quramy
14
2.3k
Featured
See All Featured
A Philosophy of Restraint
colly
197
16k
Writing Fast Ruby
sferik
622
60k
GraphQLとの向き合い方2022年版
quramy
33
13k
What’s in a name? Adding method to the madness
productmarketing
PRO
17
2.7k
VelocityConf: Rendering Performance Case Studies
addyosmani
321
23k
In The Pink: A Labor of Love
frogandcode
138
21k
Fontdeck: Realign not Redesign
paulrobertlloyd
76
4.9k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
12
1.1k
StorybookのUI Testing Handbookを読んだ
zakiyama
13
4.7k
Rebuilding a faster, lazier Slack
samanthasiow
74
8.3k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
245
20k
Thoughts on Productivity
jonyablonski
60
3.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