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
理論と実務のギャップを超える
eycjur
0
160
デミカツ切り抜きで面倒くさいことはPythonにやらせよう
aokswork3
0
250
What's new in Spring Modulith?
olivergierke
1
160
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
300
Foundation Modelsを実装日本語学習アプリを作ってみた!
hypebeans
0
120
他言語経験者が Golangci-lint を最初のコーディングメンターにした話 / How Golangci-lint Became My First Coding Mentor: A Story from a Polyglot Programmer
uma31
0
300
SwiftDataを使って10万件のデータを読み書きする
akidon0000
0
220
Go言語の特性を活かした公式MCP SDKの設計
hond0413
1
290
Goで実践するドメイン駆動開発 AIと歩み始めた新規プロダクト開発の現在地
imkaoru
4
860
Developer Joy - The New Paradigm
hollycummins
1
200
ALL CODE BASE ARE BELONG TO STUDY
uzulla
25
6.4k
技術的負債の正体を知って向き合う
irof
0
200
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
Agile that works and the tools we love
rasmusluckow
331
21k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.6k
[RailsConf 2023] Rails as a piece of cake
palkan
57
5.9k
The Invisible Side of Design
smashingmag
302
51k
How to train your dragon (web standard)
notwaldorf
97
6.3k
It's Worth the Effort
3n
187
28k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.7k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
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