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
100
Must It Always Be About Sex?
jaw6
2
190
Other Decks in Programming
See All in Programming
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
200
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
170
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
0
100
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
950
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.4k
それ、本当に安全? ファイルアップロードで見落としがちなセキュリティリスクと対策
penpeen
7
2.4k
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
360
Implementation Patterns
denyspoltorak
0
270
Oxlintはいいぞ
yug1224
5
1.2k
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
410
Denoのセキュリティに関する仕組みの紹介 (toranoana.deno #23)
uki00a
0
270
Featured
See All Featured
Speed Design
sergeychernyshev
33
1.5k
Test your architecture with Archunit
thirion
1
2.1k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
160
WENDY [Excerpt]
tessaabrams
9
36k
How Software Deployment tools have changed in the past 20 years
geshan
0
31k
BBQ
matthewcrist
89
10k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
400
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
The World Runs on Bad Software
bkeepers
PRO
72
12k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
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